-
What will be the output of the following C code? (Assuming that we have entered the value 2 in the standard input).
#include <stdio.h>
int main()
{
int var;
printf("Enter a value between 1 to 2: ");
scanf("%d", &var);
switch (var, var + 1)
{
case 1:
printf("Option 1.");
break;
case 2:
printf("Option 2.");
break;
default :
printf("Default option.");
}
}
-
- Option 1.
- Option 2.
- Default option.
- Compilation Error
- None of these
Correct Option: C
Default option.