State the Difference Between While and Do While Loop.
Advertisements
Questions
State the difference between while and do-while loop.
Distinguish between while and do-while loop.
State one difference between while loop and do-while loop.
Distinguish Between
Advertisements
Solution
| S. No. | while loop | do-while loop |
| 1. | It is an entry-controlled loop. | It is an exit-controlled loop. |
| 2. | The statements can be executed. | The loop executes the statement at least once. |
| 3. | The condition is tested before execution. | The condition is tested after execution. |
| 4. | The loop terminates if the condition becomes false. | If the condition is false, the computer keeps executing the loop. |
shaalaa.com
Notes
Students should refer to the answer according to their questions.
Introduction of Nested Loop
Is there an error in this question or solution?
Chapter 1.09: Iterative Constructs in Java - EXERCISES [Page 124]
