this post was submitted on 17 Mar 2025
1332 points (99.8% liked)
Programmer Humor
34442 readers
276 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
for( int i = 0; i < 10; i ++)
This reads as "assign an integer to the variable
I
and put a 0 in that spot. Do the following code, and once completed add 1 toI
. Repeat untilI
reaches 10."Int
I
= 0 initiatesI
, tells the compiler it's an integer (whole number) and assigns 0 to it all at once.I
++ can be written a few ways, but they all say "add 1 to I"I
< 10 tells it to stop at 10For tells it to loop, and starts a block which is what will actually be looping
Edits: A couple of clarifications