The goto statement
This statement can be used to branch to another statement of the program. This is rarely used as it violates the principle of structured programming. Though we can use it when we require to exit from deeply nested loops. The general format is :
goto label;
where label is a name(tag) followed by a colon.
e.g.
for( . . . )
{
for( . . . )
{
for( . . . )
{
for( . . . )
{
if( condition)
goto cleanup;
}
}
}
}
cleanup: statements;
:
:
A good programmer will use control statements effectively in order to avoid the usage of unconditional branching statement - goto.