-
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = 10, m = 10;
switch (n)
{
case n*m:
printf("True ");
case n-m:
printf("False\n");
break;
}
}
-
- 10
- Compilation Error
- 10
- True
- False
Correct Option: B
Compilation Error
In function 'int main()':
error: 'n' cannot appear in a constant-expression
case n-m:
error: 'm' cannot appear in a constant-expression
case n*m:
error: 'n' cannot appear in a constant-expression
case n-m:
error: 'm' cannot appear in a constant-expression
case n-m: