Saturday, 22 August 2015

Write a C Program to Print 1,2...10 Using While Loop

#include<stdio.h>
#include<conio.h>

int main()
{

            int n=1;
            clrscr();

            while(n<=10)  // loop will be executed till n is less or equl to 10
            {
                        printf(" %d ",n);
                        n++;
            }

            getch();

            return 0;

}

No comments:

Post a Comment