If you have a break in the inner nested loop, will it terminate only the inner loop or both inner and outer loops?

  • Both the inner and outer loops
  • It depends on specific cases
  • Only the inner loop
  • Only the outer loop
A break statement in the inner nested loop will terminate only the inner loop. To break out of both inner and outer loops, you can use labels or flags.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *