Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 Point out the error, if any in the while loop. #include<stdio.h> int main() { void fun(); int i = 1; while(i <= 5) { printf("%d\n", i); if(i>2) goto here; } return 0; } void fun() { here: printf("It works"); } ?->(Show Answer!)
1. Point out the error, if any in the while loop. #include<stdio.h> int main() { void fun(); int i = 1; while(i <= 5) { printf("%d\n", i); if(i>2) goto here; } return 0; } void fun() { here: printf("It works"); }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.01 pm
A label is used as the target of a goto statement, and that label must be within the same function as the goto statement. Syntax: goto <identifier> ;
Control is unconditionally transferred to the location of a local label specified by <identifier>.
Example:
#include <stdio.h> int main() { int i=1; while(i>0) { printf("%d", i++); if(i==5) goto mylabel; } mylabel: return 0; } Output: 1,2,3,4
Control is unconditionally transferred to the location of a local label specified by <identifier>.
Example:
#include <stdio.h> int main() { int i=1; while(i>0) { printf("%d", i++); if(i==5) goto mylabel; } mylabel: return 0; } Output: 1,2,3,4