Home » C Programming » Operators » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int p = 4;
    int q = p == 3 ? getchar(): 3;
    printf("%d\n", q);
    }
    1. Compilation Error
    2. 4
    3. 3
    4. Whatever character getchar function returns
    5. Ascii value of character getchar function returns
Correct Option: E

Ascii value of character getchar function returns



Your comments will be displayed only after manual approval.