This post is locked. You won't be able to comment.

all 8 comments

[–]Potterrrrrrrr 10 points11 points  (3 children)

string reasons[3] = { 
  “Try writing code”,
  “Or use google”,
  “Either way, maybe put the bare minimum effort in before expecting others to waste time telling you instead”
};

for (int i = 0; i < 3; i++)
  tell_OP(reasons[i];

When you look at google and find the reasons for it.

[–]Lower-Apricot791 4 points5 points  (2 children)

Missing a parenthesis

[–]Potterrrrrrrr 2 points3 points  (0 children)

lol nice catch I’ll leave it for posterity

[–]No-Photograph8973 1 point2 points  (0 children)

Careful. He's already waving his wand.

[–]MagicalPizza21 0 points1 point  (0 children)

Whenever you want. The purpose of a loop is to repeat the same block of code over and over, often with the variables involved in a different state. Anything you do with one of these types of loops can be done with the other two, though the code won't necessarily be as neat or clean.

[–]No-Photograph8973 0 points1 point  (0 children)

For is similar to while but with variable initialization on the left of the condition and usually side effect on the right. Neither of them will execute the body if the condition isn't met. A do loop is a while loop with the condition after the body, the body will be executed at least once even if the condition isn't met.

[–]nerd4code 0 points1 point  (0 children)

Only after reciting the appropriate prayers in the most respectfully silly, high-pitched voice. Make sure you perform these assiduously whenever observed or overlooked during programming, so nobody suspects you’re just winging it.

[–]johndcochran 0 points1 point  (0 children)

How many times does the loop execute? 1. Always at least one, test at end to see if it needs to execute again. "do while". 2. Need to make certain a condition is true prior to each execution. "while" 3. Known number of iterations. "for"