This is a bit of a difficult question to answer. I would READ the loops from the top down. I'll assume then that you are referring to the order the code is executed in. When you see a loop structure, such as the one in your code, the outermost loop is the first thing that runs.
for (i = 0; i < 3; i++) //This indicates that whatever is in between the braces that //follow will be run 3 times. { for (j = 0; j < 4; j++) { cout << arr2d[i][j] << "\t"; } cout << endl; }
The next line of code is what is run. In your case, that's another loop. Rinse and repeat.
for (i = 0; i < 3; i++) { for (j = 0; j < 4; j++) //This loop will execute 4 times for each iteration //of the outer loop { cout << arr2d[i][j] << "\t"; //Therefore, this statement is executed //12 times in total } cout << endl; //and this one only 3, as it is outside of the inner loop. }
So how to read them? From the top down. Trace your braces, and remember that the first line of code that happens after the braces will be the one to run first. To put it in your words, "outward-in", just be sure you don't think that loops take a higher precedence than other code. If we were to insert a cout between the first and second loop, the outer loop would begin execution, then the cout, and finally the inner loop (and it's contents) followed by any statements after it.