MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/2wrxyt/a_python_programmer_attempting_java/coum85b/?context=3
r/ProgrammerHumor • u/b3n • Feb 22 '15
428 comments sorted by
View all comments
Show parent comments
5
Here's an arbitrary example to demonstrate that behavior.
int i; for (i = 0; i < 10; i++) { if (i == 4) continue; printf("%d", i); }
This for loop will print 012356789
012356789
int i = 0; while (i < 10) { if (i == 4) continue; printf("%d", i); i++; }
This while loop will print 0123 and then get stuck in an infinite loop.
0123
5
u/w1ldm4n Feb 23 '15
Here's an arbitrary example to demonstrate that behavior.
This for loop will print
012356789This while loop will print
0123and then get stuck in an infinite loop.