Monday 10 October 2011

10-10-2011 do-while loop (prints counting)


/* This program uses do while loop and prints counting from 1 to 5*/
#include <stdio.h>
#include <conio.h>
int main()
{
    int num = 1;
    do
    {
          printf("%d\n",num);
          num++ ;
    }
    while(num <=5);
    getche();
    return 0;
}

No comments:

Post a Comment