TOPUPchat logo...
Forgot password?

Select : C language | Java

Q.2] String as parameter of switch case

#include
int main()
{        char a[2]="22";
       switch(a)
       {
               case "12":
                   printf("ONE\n");
                   break;
               case "21":
                   printf("TWO\n");
                   break;
               default:
                   printf("NONE\n");
       }
               getch();
}
    

Options]

A) TWO
B) NONE
C)Runtime Error
D) compile time error        

Click to See Answer
D)compile time error    

Next | using x++ mulipletimes in C language in single expression

Previous | what doeshappen? when we go beyond the limits of char data type in c language?

Hemen Ashodia [paper setter]
Register & recharge
Male Female
I agree Terms and Conditions