#include <stdio.h>
#include <stdlib.h>

int
main ()
{
 
  int i = 0;

  for(i=0; i<10; i++)
    {
      printf("For: The index variable i is %d \n", i); 
    }

  //note the syntax: for( do something at start; until condition violated; do at end of step)  

  i= 0;
  while(i < 10 )
    {
      printf("While: The index variable i is %d \n", i);
      i=i+1;
    }
  

  i=0;
  do
    { 
      printf("startDo: The index variable i is %d ", i); 
      i+=1;  //note: same as i=i+1;
       printf("EndDo: it is  %d \n", i); 
    } while (i<10);
  //Try these loops, replacing previous test with i<0
  //when is a do/while setup better than for or while?


  return 0; 
  
}


/*
Local Variables:
compile-command: "gcc Exercise6.2.c -Wall -o exercise6.2 "
End:
*/



