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 |
write a program to find the sum of the array elements in c language?
24 Answers ICT, Infosys, Wipro,
what is the difference between NULL & NUL keywords in C?
Write a program to find minimum between three no.s whithout using comparison operator.
What is #include called?
write a program fibonacci series and palindrome program in c
0 Answers Aditi Placement Service,
Write a Program to accept different goods with the number, price and date of purchase and display them
What is the translation phases used in c language?
What is the purpose of sprintf?
#include<stdio.h> #include<conio.h> # define swap(a,b) temp=a; a=b; b=temp; void main( ) { int i, j, temp; i=5; j=10; temp=0; if( i > j) swap( i, j ); printf( "%d %d %d", i, j, temp); }
Why static is used in c?
Is it possible to have a function as a parameter in another function?
what is bit rate & baud rate? plz give wave forms