C++ goto statement

The goto statement is use to jump unconditionally from one statement to another in a program.

There are two types of jumps one in forward jump and second is backward jump.

Forward jump:

syntax:             goto label;

________

________

label:

statement;

Backward jump:

syntax:             label:

Statement;

________

________

goto label;

As the control comes at ‘goto’ the control is transferred to the label. And it breaks the sequential flow of execution.

Leave a Reply

Your email address will not be published. Required fields are marked *