48. WRITE A C PROGRAM TO EXPLAIN GOTO

/*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 4
1
2
3
4

Comments