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

write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words

5 Answers   Captronic, DELL, Google, IBM, Mithi, RCC, Wipro,


write a c program to add two integer numbers without using arithmetic operator +

13 Answers   Value Labs,


When a c file is executed there are many files that are automatically opened what are they files?

0 Answers  


Write a program for print infinite numbers

3 Answers   Wipro,


Is malloc memset faster than calloc?

0 Answers  






Who is the founder of c language?

0 Answers  


What is the purpose of sprintf() function?

0 Answers  


N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3

3 Answers   Honeywell,


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

0 Answers  


What is the value of uninitialized variable in c?

0 Answers  


What are 'near' and 'far' pointers?

0 Answers  


Explain Basic concepts of C language?

0 Answers   EXL,


Categories