0
what is meant that "do...while" loop is guaranteed to execute at least one time, in C++? Please someone should help me.
4 Réponses
+ 3
It will execute the statements written in the do { } clause no matter the condition is true or false. Then it will check the condition in the while( ) and repeat the loop if it is true. For example:
int x = 3;
do {
// some statements
}
while(x > 5);
This will execute the statements once, even considering that x is not greater than 5.
0
It means the code inside the while loop will always execute once before the condition to keep looping is checked.
0
it's do and while so it first does execute(do) and then the condition is used so it is guaranteed that it is executed whatever the case is
0
Write a C++ program to check whether an integer is positive or negative