Home » C Programming » Decision Making » Question
  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>
    int main()
    {
    int p;
    printf("Enter a value between 1 to 2:");
    scanf("%d", &p);
    switch (p)
    {
    case 1:
    printf("hey...\n");
    break;
    printf("Hello...");
    default:
    printf("How are U?\n");
    }
    }
    1. Hey...
    2. Hello...
    3. How are U?
    4. All of above
    5. None of these
Correct Option: C

How are U?



Your comments will be displayed only after manual approval.