Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    int x = 1;
    int y = x == 1 ? getchar(): 2;
    printf("%d\n", y);
    }
  2. A.
    Compile time error
    B.
    Whatever character getchar function returns
    C.
    Ascii value of character getchar function returns
    D.
    2

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    None.


Be The First To Comment