Home » C Programming » Decision Making » Question
  1. What will be the output of the following C code? (Assuming that we have entered the value 3 in the standard input).
    #include <stdio.h>
    int main()
    {
    int num;
    printf("Enter a value between 1 to 2:");
    scanf("%d", &num);
    switch (num)
    {
    case 1:
    printf("Hey...\n");
    default:
    printf("Hello...\n");
    }
    }
    1. Runtime Error
    2. Compilatin Error
    3. Hey...
    4. Hello...
    5. None of these
Correct Option: D

Hello...



Your comments will be displayed only after manual approval.