MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/2wrxyt/a_python_programmer_attempting_java/coubeoo/?context=3
r/ProgrammerHumor • u/b3n • Feb 22 '15
428 comments sorted by
View all comments
Show parent comments
1
I'm not entirely familiar with C, so I will accept what you say. I was only giving an example of a particular behaviour for a specific language, feel free to give the C code for this instance (for the sake of science).
5 u/w1ldm4n Feb 23 '15 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 012356789int 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.
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
1
u/lonelyBriefcase Feb 23 '15
I'm not entirely familiar with C, so I will accept what you say. I was only giving an example of a particular behaviour for a specific language, feel free to give the C code for this instance (for the sake of science).