0
Why this code for continue outputs 16?
continue function = need help for explanation I'm really confuse https://code.sololearn.com/WhqWZZ8m6nLZ/?ref=app
2 ответов
+ 5
i starts at 4.
i == 6?
Is 4 equal to 6?
No, false.
sum += 4, sum = 4.
i = 5.
i == 6?
Is 5 equal to 6?
No, false
sum += 5, sum = 9
i = 6.
i == 6?
Is 6 equal to 6?
True,
Continue,
i = 7.
i == 6?
Is 7 equal to 6?
false,
sum += 7, sum = 16
i = 8.
8 < 8, this is false so the loop stops.
sum = 16.
0
I see. very well explained. clearly understand now. hehe
Thanks for the help!
cheers!