+ 1
Why is it printing 1 indefinitely??
5 Antworten
+ 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 :)