C Programming Reference >> C Basic Tutorials >> C Keywords Home >> gotoui 30/12/06 - Views - Ratings : Goto is used for jumping from one stament to another. It can also be used for generating loops. You cann't jump from one function to another. To mark a point to jump to label stament is used. Use of goto is highly discouraged in C Programming due its inherent properties of breaking the code and making it unreadable. Code - void function (void)
{
a = 1;
loop:; // label stament
printf ("\n%d",a);
a++;
if (a < 10) goto loop ; // jump statement
}
|