C Go To Statement

In this tutorial you will learn about the C Go To Statement and its application with practical example.

C goto statement

The c goto statement is used to alter the normal execution of a program and transfer control to a labeled statement in the same program. We can have multiple goto and label statements in a c program. The goto statement is followed by a label name. The label is an identifier, which can be any plain text. It can be set anywhere in a c program. The label can be defined above or below to go to the statement. When a goto statement is encountered the compiler transfers the control to a label: specified with a goto statement. Then compiler begins execution from there.

GoTo Statement Syntax

Below is the general syntax of the goto statement in c programming:

Syntax:-

Program Structure:-

goto Statement Example

Below is a simple example to demonstrate the use of the goto statement in c programming:

Example:-

Output:-

c-goto-statement

In this tutorial we have learn about the C Go To Statement and its application with practical example. I hope you will like this tutorial.