Loop forever:
while(true)
{
("meow")
printf}
Repeat n (3) times:
int i = 0;
while (i < 3)
{
("meow")
printf++;
i}
For n (3) times:
for (int i = 0; i < 3; i++)
{
("meow")
printf}
Key Takeaway: There’s many ways to do loops, which is why conventions (e.g., using
int i
for counters, starting at0
) are important
There are subtle differences in differences of scope between while and for loops, but they can generally do the same things