+ 1
do while loop
what is the application of do while loop ?
2 ответов
+ 8
When you want a block of code to execute at least once. There are times when such cases are compulsory, e.g.
do
{
// randomly initialize an empty variable
}
while (// variable is not within a range);
+ 1
It will run the code and then check the condition to execute code, if condition is true.