#include<stdio.h> #include<conio.h> void main() { int i,n; /* i for loop counter, n for the extreme boundary */ clrscr(); printf("\n Enter the upper limit\n"); scanf("%d",&n); printf("\n Numbers from 1 to %d are \n",n); for(i=1;i<=n;i++) /* the loop which repeats 'n' times */ printf("%5d",i); /* each time the condition gives true the value of 'i' gets printed. */ getch(); } Output Enter the upper limit 10 Numbers from 1 to n are 1 2 3 5 6 7 8 9 10