#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


Please Help Members By Posting Answers For Below Questions

When should you not use a type cast?

661


How do we open a binary file in Read/Write mode in C?

680


What are global variables and explain how do you declare them?

580


In a switch statement, explain what will happen if a break statement is omitted?

639


What extern c means?

546






What is volatile keyword in c?

583


Differentiate between calloc and malloc.

761


Can we access array using pointer in c language?

647


What is a memory leak? How to avoid it?

577


Is there any demerits of using pointer?

631


Subtract Two Number Without Using Subtraction Operator

357


What is use of pointer?

587


What is adt in c programming?

611


Is c object oriented?

542


What are the properties of union in c?

590