an example of goto function in can example of goto function in c

#include<conio.h>
#include<stdio.h>
int main( )
{
int x;
printf("enter x");
scanf("%d",&x);
if(x>5)
goto sj;
else
{printf("x is less or equal to than 5 so you r in a non goto location \n");
goto eof;
}
sj:
printf(" x>5 so you are in goto directed statement\n");
eof:
getch();
}

               OUTPUT

enter x
5
x is less or equal to than 5 so you r in a non goto location

No comments:

Post a Comment