GUESS THE OUTPUT

GUESS THE OUTPUT

int inum = 2;

switch( inum )

{

case 1.5:

printf("one and half");

break;

case 2:
printf("two");

break;

case A:
printf( "A is a character");

break;

default:
printf(" invalid ");

break;
}













ANSWER- WE WOULD GET ERROR BECAUSE VALUES IN THE CASES MUST BE INTEGERS

No comments:

Post a Comment