Advertisements
Advertisements
Question
Which of the following statements is not valid for a nested loop?
Options
The break statement can be used to terminate inner as well as outer loop.
The outer loop can be terminated from the block of inner loop.
The inner loop can be terminated from the block of outer loop.
The inner loop repeats the execution a number of times for each iteration of the outer loop.
MCQ
Solution
The inner loop can be terminated from the block of outer loop.
Explanation:
The inner loop cannot be directly controlled or ended by the outer loop's block. The outer loop can influence the execution of the inner loop by regulating when or if it starts, but the inner loop must be terminated inside its own scope, or by using a break statement inside the inner loop.
shaalaa.com
Is there an error in this question or solution?