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

Answer Posted / surenda pal singh chouhan

Compiler Error: Constant expression required in function
main.

Explanation:
The case statement can have only constant expressions (this
implies that we cannot use variable names directly so an
error).
Note:
Enumerated types can be used in case statements.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is main return c?

519


What are the advantages of the functions?

604


State two uses of pointers in C?

638


what are the facialities provided by you after the selection of the student.

1658


What is double pointer in c?

588






What is zero based addressing?

713


What is an endless loop?

800


How was c created?

589


Why do we use int main?

610


Explain how do you search data in a data file using random access method?

696


What are the features of the c language?

646


What is echo in c programming?

557


Write a progarm to find the length of string using switch case?

1612


How does normalization of huge pointer works?

637


Is c is a low level language?

563