+ 10
What is difference between loops?
do ... while loop and while loop are almost same, only difference is in their framework. Is there anymore diffference?
9 Antworten
+ 3
While loop is an entry control loop
It is used when no of iterations are not known
But loop has to continue until certain condition is satisfied
Syntax
while(condition)
{
[statements];
[inc/dec];
}
Do while loop is an exit control loop
This loop executes statements atleast once with independence of condition check
This is used to create menu driven programming
Syntax
do
{
[statements];
[inc/dec];
}
while(condition);
+ 6
Do while run atleast one time even if condition is false.
+ 5
https://www.geeksforgeeks.org/difference-between-while-and-do-while-loop-in-c-c-java/amp/
Read this reference . Geeks for geeks is amazing.
+ 4
It is all the same
+ 4
The While loop is
while (cond) {
//code
}
While the Do...while loop is
do {
//code
} while (cond)
But does the same thing
+ 3
Is that the only difference?
Nevertheless, thanks for your help!
Harsh Gaur
+ 3
This meme can also demonstrate while vs do-while 😆
https://www.sololearn.com/post/1425077/?ref=app
+ 3
difference between loop is syntax, defination, structure,
+ 1
Yes bro what they said absolutely correct . Nice