Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads
Distinguish Between
Differentiate While and Do while loops.
Advertisement Remove all ads
Solution
While loop | Do while loop |
The while statement will execute a block of code if and as long as a test expression is true. | Do while loop always run the statement inside of the loop block at the first time execution. |
If the test expression is true then the code block will be executed. After the code has executed the test expression will again be evaluated and the loop will continue until the test expression is found to be false. | Then it is checking the condition whether true or false. It executes the loop if the specified condition is true. |
|
|
Concept: Looping Structure
Is there an error in this question or solution?