-
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");
}
}
-
- 1
- Hey...
- 2
- Compilation Error
- Runtime Error
Correct Option: C
2