/*
  for loops. see Nyhoff P127-130
  
  Try changing i++ to ++i or i-- what happens?
  What is the value of i after the for?
*/

#include <stdio.h>


int main()
{
// In C we declare the variables at the top of each function before using them.
// No variable definitions in local scopes.

   int a=2;
   int i;

   for (i=0 ; i<5 ; i++)                              
     {                                                   // variable i only exists 
        printf("i=%d ai=%d\n",i,a*i);
     }

   return 0;
}
