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



main() { int i=1; while (i<=5) { printf("%d",i); if (i&..

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

main() { int i=1; while (i<=5) { printf("%d",i); if (i&..

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

main() { int i=1; while (i<=5) { printf("%d",i); if (i&..

Answer / dinakaran gct

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

Post New Answer

More C Interview Questions

what is printf

5 Answers   MVSR, Satyam,


#include <stdio.h> int main ( int argc, char* argv [ ] ) { int value1 = 10; int value2 = 5; printf ( "\n The sum is :%d", value1 | value2 ); } This is the answer asked by some one to add two numbers with out using arithmetic operator?Yes this answer is write it given out put as 15.But how????? what is need of following line? int main ( int argc, char* argv [ ] ) how it work?what is the meaning for this line? please explain me.Advance thanks

9 Answers   Excel,


how to write optimum code to divide a 50 digit number with a 25 digit number??

0 Answers   MGM,


Write a program for Overriding.

0 Answers  


What is the difference between big endian form and little endian form? write a code to convert big endian form to little endian and vice versa..

5 Answers   Aricent, TCS,






Which of the following is not a valid declaration for main ()? 1) int main() 2) int main(int argc, char *argv[]) 3) They both work

2 Answers  


How can I read a directory in a c program?

1 Answers   CSC,


Explain what are reserved words?

0 Answers  


How is = symbol different from == symbol in c programming?

0 Answers  


What is a dynamic array in c?

0 Answers  


How was c created?

0 Answers  


What is the c language function prototype?

0 Answers  


Categories