Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    float x = 'a';
    printf("%f", x);
    return 0;
    }
  2. A.
    a
    B.
    run time error
    C.
    a.0000000
    D.
    97.000000

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    Since the ASCII value of a is 97, the same is assigned to the float variable and printed.
    Output:
    $ cc pgm8.c
    $ a.out
    97.000000


Be The First To Comment