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 abstract data structure in c?

0 Answers  


Can a pointer point to null?

0 Answers  


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


Write a program in c to print * * * * * *******

1 Answers  


enum { SUNDAY, MONDAY, TUESDAY, }day; main() { day =20; printf("%d",); getch(); } what will be the output of the above program

1 Answers  






write an algorithm which can find the largest number among the given list using binary search ............... this was asked in the interview

2 Answers   Satyam, UNIS, Wipro,


which will return integer? a) int*s ( ) b) ( int* ) s( ) c) int ( *s ) ( )

1 Answers   C DAC,


int main() { int days; printf("enter days you are late"); scanf("%d",days); if (days<=5) printf("5o paisa fine"); if (days<=10&&days>=6) printf("1rs fine"); if(days>10) printf("10 rs fine"); if(days=30) printf("membership cancelled"); return 0; } tell me whats wrong in this program? is it right?

2 Answers  


What is 02d in c?

0 Answers  


How do you write a program which produces its own source code as its output?

2 Answers  


Is it possible to pass an entire structure to functions?

0 Answers  


Find the highest of three numbers and print them using ascending orders?

1 Answers  


Categories