- goto statements and labelname
-
syntax and use of goto and lanbelname
example of goto statement and labelname
example of goto statement and labelname
goto statement and labelname
goto statement
goto is an unconditional construct it helps us to jump the control from one location to another location within the program. The location within the program is marked by a labelname.
Syntax:
goto labelname;
Example:
goto abc;
goto xyz;
goto Pqr;
goto a;
Labelname
label name helps to mark a location in the program, where the control can jump with the help of goto statement.
Syntax:
labelname:
Example:
abc:
xyz:
pqr:
a:
a1:
Note: label name can be anything, but should not be a keyword. Should follow the rules of an identifier.