The goto statement is used to transfer control of the program to the specified label. For example:
for(i=1; i<5; ++i) { if (i==10) goto error; } printf("i is not 10"); error: printf("Error, count cannot be 10.");
Output
Error, count cannot be 10.
The goto statement is used to transfer control of the program to the specified label. For example:
for(i=1; i<5; ++i) { if (i==10) goto error; } printf("i is not 10"); error: printf("Error, count cannot be 10.");
Output
Error, count cannot be 10.