#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
Does c have circular shift operators?
how is the examination pattern?
What is the deal on sprintf_s return value?
What is bash c?
What is dynamic memory allocation?
What is new line escape sequence?
What are the types of data structures in c?
What is wrong with this initialization?
How do you list files in a directory?
What are the three constants used in c?
write a program to find the given number is prime or not
Define the scope of static variables.
Explain is it valid to address one element beyond the end of an array?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is scope rule in c?