+ 1
do while loop
loop
5 odpowiedzi
+ 18
Please elaborate your question... where are you facing difficulties in loops..
https://www.sololearn.com/discuss/333866/?ref=app
+ 4
int a=2;
do{
cout<<a;
a++;
}
while (a<=6);
+ 4
do while loop first runs the statement and then check the condition i.e even if condition is false it will execute once(which makes it different from while loop)
---------------------------------
syntax in c: do
{
statement(s);
}
while( condition );
--------------------------------------------------------
syntax in java: int x = 1;
do {
System.out.println(x);
x++;
} while(x < 5);
/*
output
1
2
3
4
*/
+ 2
do while loop will at least run the statement once no matter even it is false.
- 1
Rearrange the blocks to form a correct do while loop
$i++
do {
$i = 0;
} while ($i < 10):