#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
Why does everyone say not to use gets?
What is volatile c?
Difference between Function to pointer and pointer to function
Which node is more powerful and can handle local information processing or graphics processing?
When should we use pointers in a c program?
how to build a exercise findig min number of e heap with list imlemented?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Should I learn data structures in c or python?
Explain what is a stream?
code for quick sort?
Explain pointers in c programming?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is #include in c?
What is #define in c?
Write a progarm to find the length of string using switch case?