In a difficult programming bearings it seems so simple to accomplish use of a goto to yield the ascendancy area you need. However, always, there is a added affected way of autograph the aforementioned affairs application if, for, while and switch. These constructs are far added analytic and aboveboard to understand.
The huge affair with gotos is that if they do use them they can hardly be abiding how they got to a abiding point in our code. They abstruse the breeze of control. The GOTO keyword is basically used to get over a certain set of instructions instantly.a program illustrating this is shown below:




/*Demonstration of goto keyword*/

main
{
 int m, n, l ;
for ( m = 1 ; m <= 3 ; m++ )
{
for ( n = 1 ; n <= 3 ; n++ )
{
for ( l = 1 ; l <= 3 ; l++ )
{
if ( m == 3 && n == 3 && l == 3 )
goto out ;
else
printf ( "%d %d %d\n", m, n, l ) ;
}
}
}
out :
printf ( "Out of the loop" ) ;
}


0 comments to "THE GOTO STATEMENT IN C LANGUAGE"

Post a Comment

Powered by Blogger.