#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
Are c and c++ the same?
What is bubble sort in c?
What are the complete rules for header file searching?
How can a program be made to print the line number where an error occurs?
Why is #define used?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
How to write a multi-statement macro?
How can I convert a number to a string?
What is wrong with this program statement?
Explain how can I convert a number to a string?
What are categories used for in c?
Which is better between malloc and calloc?
Write a program to swap two numbers without using the third variable?
What is the -> in c?
When can a far pointer be used?