/*program to explain goto*/
#include<stdio.h>#include<conio.h>
int main()
{
int i=1,n;
clrscr();
printf(“enter a number\n”);
scanf(“%d”,&n);
natural:
printf(“%d\n”,n);
i=i++;
if(i<=n);
goto natural();
getch();
return 0;
}
output
enter a number 41
2
3
4
Comments
Post a Comment