In any programming language, loops are used to execute a set of statements repeatedly until a particular condition is satisfied.
How it Works
A sequence of statements are executed until a specified condition is true.
This sequence of statements to be executed is kept inside the curly braces { } known as the Loop body.
After every execution of loop body, condition is verified, and if it is found to be true the loop body is executed again.
When the condition check returns false, the loop body is not executed.
for loopwhile loopdo while loop
what is the difference between all three loops? Why C programming language has 3 loops if all works the same way. I have read an article of loops in that article everything is discussed but not the difference, So I am asking this to you.
Ask Question