#include<stdio.h>
#include<conio.h>
#define L 10
void main()
{
auto money=10;
switch(money,money*2)
{
case L:printf("William\n");
break;
case L*2:printf("Super\n");
break;
case L*3:printf("hello!\n");
break;
default:printf("Wrong answer\n");
break;
case L*4:printf("hi!");
break;
}
getch();
}
I thought it wont compile but it is compiling and the output is
Super
Super
can anyone explain me its working??
how can Switch statement take two arguments??

New Topic/Question
Reply


MultiQuote


|