• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Why is the second for first added and not in order?

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello g day, i am trying to fill a matrix with 2 paras, why first add the subindex c if the first para is with subindex f? thank you.
ps: as you can see in the debuggin i did (i don't know how to written exactly in english, sorry)
DIAGONALES-1EROLLENAEL2DOPARA.png
[Thumbnail for DIAGONALES-1EROLLENAEL2DOPARA.png]
 
Sheriff
Posts: 17711
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's just how nested loops work. The inner (second) for-loop is executed fully every time time the outer loop is executed.

The output of this code will give you an idea of the order of execution:

 
Rancher
Posts: 326
14
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
unrelated side-note:

@OP
Please use code-tags and post code as text instead of screenshots. Some users, including myself, use the ranch on mobile devices. Trying to read screenshots often is hard on such small screens.
 
lowercase baba
Posts: 13091
67
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Matthew Bendford wrote:unrelated side-note:Trying to read screenshots often is hard on such small screens.


I'm on a laptop with a widescreen monitor, and I have a hard time reading screenshots, too.  Some of us are just old.
 
Trust God, but always tether your camel... to this tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic