04 b] Explain the working of go to statement in C programming.
Answer:-
“goto is an unconditional branching statement“
Syntax:-
goto label; statement1; statement2; label:
➢ A label is a valid variable name.
➢ Label need not be declared and must be followed by a colon.
➢ Label should be used along with a statement to which control is transferred.
➢ Label can be anywhere in the program either before or after the goto label.
➢ Here control jumps to label skipping statement1 and statement2 without verifying any condition that is the reason we call it an unconditional jumping statement.
Example:-