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 main function in c?

0 Answers  


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?

1 Answers  


What is 'bus error'?

0 Answers  


how to compare two strings without using strcmp() function??

1 Answers  


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

0 Answers  






what r callback function?

1 Answers  


what is the self-referential structure?

1 Answers  


write a program to generate 1st n fibonacci prime number

2 Answers  


main() {int a=200*200/100; printf("%d",a); }

14 Answers   TCS,


WHOT IS CHAR?

4 Answers   TCS,


how to connect oracle in C/C++.

3 Answers   TCS, Wipro,


what is diff between localstatic and globalstatis variable possible 2 use in another file...?

2 Answers   HCL,


Categories