Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    char chr;
    chr = 128;
    printf("%d\n", chr);
    return 0;
    }
  2. A.
    128
    B.
    - 128
    C.
    Depends on the compiler
    D.
    None of the mentioned

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    signed char will be a negative number.
    Output:
    $ cc pgm2.c
    $ a.out
    -128


Be The First To Comment