Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 31

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 95

Answer:

main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
}


Answer:
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.


Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 31 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: