goto Statements In C Language

goto Statement

The C language provides a method to transfer control to a labeled point in the program.

The goto statement is used to alter the normal sequence of program execution by transferring control to some other part of the program.

The goto statement requires a destination label, declared as label: . Where, label is an identifier word followed by a semicolon(:) .

The goto statemet is called by using goto statement-label.

Syntax:

goto label;
- - - - - - - - - -
- - - - - - - - - -
label:
- - - - - - - - - -
- - - - - - - - - -

Example:



Output:

 Statement 1.
 Statement 2.
 Statement 3.
 End of Program.


Read Also: