4.5. for

for is similar to while, it's just written differently. for statements are often used to proccess lists such a range of numbers:

Example 4-4. for_ten.c

#include <stdio.h>

int
main()
{
  int i;

  /* display the numbers from 0 to 9 */
  for (i = 0; i < 10; i++)
    printf("%d\n", i);

  return 0;
}