Search Your C Program

Tuesday 7 February 2012

Program to display digits 1 to n.

#include<stdio.h>
#include<conio.h>
void main()
{
                  int n, i=1;
                  clrscr();
                  printf("\n Enter the last digit");
                  scanf("%d",&n);
                  while(i<=n)
                  {
                                  printf("\n %d",i);
                                  i++;
                  }
                  getch();
}
                       

No comments:

Post a Comment