Saturday, 26 June 2010

simple program on while loop

#include <stdio.h>

void main () {
   /* local variable definition */
   int a = 3;
   /* while loop execution */
   while( a < 5 ) {
      printf("value of a: %d\n", a);
      a++;
   }

}

You may like the following posts:

looping statements or repetative statements

   for loop
   while loop
   do-while

No comments:

Post a Comment