State the Difference Between While and Do While Loop.
Advertisements
प्रश्न
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.
अंतर स्पष्ट करें
Advertisements
उत्तर
| 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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.09: Iterative Constructs in Java - EXERCISES [पृष्ठ १२४]
