0

I think it's wrong loop

var x=0; do{ x++; } while(x>=10);

1st May 2017, 7:50 PM
Kristina Hakobyan
Kristina Hakobyan - avatar
3 odpowiedzi
+ 6
Yep must be <= 10 >=10 is false at beginning
1st May 2017, 7:55 PM
Yanothai Chaitawat
Yanothai Chaitawat - avatar
+ 3
i think you should change it to x <= 10 the way it is now, it goes through the loop once, so now x is 1. but then the loop stops because (1 >= 10) is false
1st May 2017, 7:51 PM
Edward
0
The condition is false, then the loop execute once, increase de value of X and finish de loop.
11th May 2017, 9:48 AM
carlos b.p.
carlos b.p. - avatar