answersLogoWhite

0

Sometimes you have to use nested loops, in this case one of them is the outer, the other is the inner.

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

BeauBeau
You're doing better than you think!
Chat with Beau
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake

Add your answer:

Earn +20 pts
Q: Why you use inner loop and outer loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you determine which is outer loop or inner loop of the Baltimore beltway?

The outer loop goes counter clockwise, while the inner loop goes clockwise. For example, if you're driving from Fairfax, VA to Washington, DC you're going on the inner loop, and on the way back you're taking the outer loop.


When loops are nested does one loop have to end before the other begins?

If one loop ends before the next begins then they are not nested at all -- they are completely independent. To be nested, one loop must contain the other loop in its entirety. That is, the inner, nested loop must start and end within the outer, containing loop. Nested loop example (in C++): for( int x = 0; x < 10; ++x ) // outer loop { for( int y = 0; y < 10; ++y ) // inner loop (nested loop) { printf( "%d x %d = %d\r\n", x, y, x*y ); } // end of inner loop } // end of outer loop


How can you print 5 54 543 5432 54321 in java using for loop?

With two nested loops. In the outer loop, a variable - we might call it "n" - would go from 5 down to 1, in the inner loop, the variable (whatever you call it) goes from 5 down to n. Write out each digit in the inner loop; in the outer loop you need to add the extra space.


How do you exit in nested loop in java?

You may exit a nested loop in Java using a break with a label for the outer loop.


To print 5 45 345 2345 12345 in qbasic programming?

Oh, dude, to print those numbers in QBasic, you can use a simple loop. Just loop from 1 to 5 and print the numbers with spaces in between. It's like making a sandwich, but with numbers instead of bread and cheese. So, like, don't stress, just code it up and hit run. Easy peasy, right?