KodeGod.com

025. Write a Program to print numbers 1 to n using while loop in C language

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