+ 1
Do While
When is do-while usually used?
3 Answers
+ 8
do-while is an EXIT control loop. It first executes the statement for one time and then checks the given condition.
It is mostly used to make our program user-friendly that is for asking the user like "do you want to continue (y/n) : ".
If the user enters y it repeats again.
and if the user enters n it gets out of loop as you have set the condition as while(ch==y);
+ 4
Hello Namnu Namnu! Check out the answers in these discussions. They should help. I was gonna answer but then it occured to me that answers are already out there somewhere.
The second link contains links to more discussions.
https://www.sololearn.com/Discuss/1233953/?ref=app
https://www.sololearn.com/Discuss/840631/?ref=app
+ 2
not technical:
you know the end point of loop where you want to stop.