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 are the stoge class in C and tel the scope and life time of it?
What are pointers? Why are they used?
how to find out the reverse number of a digit if it is input through the keyboard?
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }
Why are algorithms important in c program?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
How can I get back to the interactive keyboard if stdin is redirected?
What is the maximum length of an identifier?
what is self refrential structure
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?
Program to display given 3 integers in ascending order
what is the value of 'i'? i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
7 Answers Cadence, JNTU, Zen Technologies,