Goto Statement - C Tutorial

Goto Statement

goto is a jump statement used to transfer program control unconditionally from one part of a function to another. I have used the word unconditionally because there is no restriction on control transfer. You can transfer program control from one position to any position within a function. Many programmers uses goto to gain full control on their program.

Syntax of goto statement

goto label;
... .. ...
... .. ...
... .. ...

The label is an identifier. When goto statement is encountered, control of the program jumps to label: and starts executing the code.

Go to Statement