+ 1
Why is it printing 1 indefinitely??
5 Answers
+ 3
Thanks Wilbur Jaywright
Thank you so much Martin Taylor
+ 2
oh, thank you very much! :-) Since I might have made the same mistake in JavaScript, this might save me a little âhard way.â
+ 1
iâm not sure why this doesnât work, but I do know itâs not the traditional way to do it. The incrementer should be in the for loop statement, and the print part should be in the main code, not the other way around.
+ 1
Martin Taylor i know we shouldn't put the semicolon in for loop, or else it'd terminate the statement.
It was a exercise problem, but even if I removing the semicolon, in output I'm getting 6.
So,okay the 1 is happening only for semicolon
Haha, okay okay
Thanks again @martin Taylor :)