Difference between While and Do-While loops

Yesterday I told you I was learning C. Today I reviewed the While and Do-While loops and they at first seemed like the same thing but they have a very basic and fundamental difference that I’m posting today to have a reminder if someday I forgot it. So, whát’s the difference between While and Do-While loops?

In While loop the condition is tested first and if it happens to be true then it executes the statements in the loop. In Do-While the statements are executed first and then the condition is tested, in that case if the condition happens to be false the statements are executed at least one time.

0 comments

Please insert the result of the arithmetical operation from the following image
Enter the result of the arithmetical operation from this image