C - Goto Statement


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

2.In its general form, the goto statement is written as
goto label;
where label is an identifier used to identify the target statement to which control will be transferred.

3. Control may be transferred to any other statement within the program. To be more precise, control may be transferred anywhere within the current function.

4. The target statement must be labeled, and a colon must follow the label. thus, the target statement will appear as : label:statement

5.Each labeled statement within the program ( more precisely, within the current function ) must have a unique label , i.e. no two statements can have the same label.


  • Print Page