#include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}

Answer Posted / suresh reddy

Compiler Error: Constant expression required in function
main

instead of using j u we can use case 'j' .

this is correct answer

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between text and binary modes?

632


What is the use of a static variable in c?

578


Does c have circular shift operators?

710


What is an array in c?

581


What is array of pointers to string?

554






Do you know the use of 'auto' keyword?

648


Explain what is the difference between #include and #include 'file' ?

571


Describe the modifier in c?

588


explain what is fifo?

624


When would you use a pointer to a function?

574


What is #line used for?

568


Write a program for Overriding.

668


In a switch statement, explain what will happen if a break statement is omitted?

615


What are the 4 types of organizational structures?

613


How do you sort filenames in a directory?

696