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 |
Do pointers store the address of value or the actual value of a variable?
who is the founder of c
19 Answers College School Exams Tests, HP,
What is the heap?
Why is C language being considered a middle level language?
How can I delete a file?
How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamically from a to z and do not print this using pgm like this print("Ab......"); Use loops or anything to print all alphabets
What is the easiest sorting method to use?
What does sizeof return c?
main() { charx; while (x=0;x<=255;x++) printf("\nAscii value %d Character %c,x,x); }
What is the need of structure in c?
#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā); #endif
What is difference between arrays and pointers?