Go To Statement

C Language supports go to statement to breach uncoditionally from one point to another in the program.

The go to statement required a label in order to identify the place where the branch is to be made.

A Label is any valid variable name, and must be followed by colon. The Label is placed immediately before the statement where the control is to be transferred.

 

  C Language go to statement :-

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
int n;
printf("Enter the no");
scanf("%d", &n);
if(n<=10)
goto no;
else
{
printf("\n No. is greater than the 10");
printf("\n Enjoy the C Language.");
exit(0);
}
no:
printf("No is smaller than 10");
getch();
return 0;
}




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top