Goto Statement

Goto Statement is used to transfer the flow of control to a line following the specific label.
It should be noted that the label is within the same scope as the goto statement is .It means that for egample we cannot jump into another function from some other function using the goto statement.
Use of goto statement is not suggested since it makes the program flow hard to understand and modify.



Syntax for 'Goto Control'


goto label;

label : {statements}




C Example


#include<stdio.h>

int main() {

	printf("one\n");

	goto print;

	printf("three\n");

	printf("four\n");

	print:

	printf("two\n");

	printf("goto works");

	return 0;

}