1.

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>
void main()
{
int num;
printf("Enter a value between 1 to 2:");
scanf("%d", &num);
switch (num)
{
case 1:
printf("1 n");
break;
printf("Hey...");
default:
printf("2 n");
}
}

A. 1
B. Hey...
C. 2
D. Compilation Error
E. Runtime Error
Answer» D. Compilation Error


Discussion

No Comment Found

Related MCQs