main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
}
Answers were Sorted based on User's Feedback
Answer / surenda pal singh chouhan
Compiler error: Undefined label 'here' in function main
Explanation:
Labels have functions scope, in other words The scope of
the labels is limited to functions . The label 'here' is
available in function fun() Hence it is not visible in
function main.
Is This Answer Correct ? | 16 Yes | 0 No |
Answer / jaroosh
Exactly, to be able to move control flow to here, you would
have to make a long jump using not very common functions
(that do actually more than goto) : setjmp and longjmp
(please look up those functions in google or some C standard
library reference).
Is This Answer Correct ? | 5 Yes | 1 No |
The program is error because of the "goto" statement can't
jump from one segment to another segment i.e not support for
long jump.
Is This Answer Correct ? | 3 Yes | 0 No |
What is main function in c?
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?
What is 'bus error'?
how to compare two strings without using strcmp() function??
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
what r callback function?
what is the self-referential structure?
write a program to generate 1st n fibonacci prime number
main() {int a=200*200/100; printf("%d",a); }
WHOT IS CHAR?
how to connect oracle in C/C++.
what is diff between localstatic and globalstatis variable possible 2 use in another file...?