Program:
#include<stdio.h>
#include<conio.h>
void main()
{
int n, i=1;
clrscr();
printf("Enter a Number : ");
scanf("%d", &n);
printf("Natural Numbers from 1 to %d is : ", n);
lb;
printf("\t%d", i);
i++;
if(i<=n)
goto lb;
getch();
}
Output:
Enter a Number : 10
Natural Numbers from 1 to 10 is :
1 2 3 4 5 6 7 8 9 10
Next Topic :
Previous Topic :
No comments:
Post a Comment