#include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}
Answer Posted / shruti
nopes we cannot use 'j'... because single qutoes ' ' are
used only for character value.. i.e if it was
char i
switch(i)
then we cud have used it like that..
hence in our case,
it will give a compiler error...
Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
When should you not use a type cast?
How do we open a binary file in Read/Write mode in C?
What are global variables and explain how do you declare them?
In a switch statement, explain what will happen if a break statement is omitted?
What extern c means?
What is volatile keyword in c?
Differentiate between calloc and malloc.
Can we access array using pointer in c language?
What is a memory leak? How to avoid it?
Is there any demerits of using pointer?
Subtract Two Number Without Using Subtraction Operator
What is use of pointer?
What is adt in c programming?
Is c object oriented?
What are the properties of union in c?