Some questions on for loops
What is the output from the following loops?
for (i=3; i>=1; i--) printf("%d\n", i);
for (i=0; i<=3; i++) printf("%d\n", i);
What is the while loop equivalent to each of the above loops?
Put each of these examples, including the while loop equivalents, into a program, compile and run them. Make sure they behave identically.
Answers to these questions
Back to the notes on for loops