Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    #define a 20
    int main()
    {
    const int a = 50;
    printf("a = %d\n", a);
    }
  2. A.
    a = 50
    B.
    a = 20
    C.
    Run time error
    D.
    Compilation Error

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    The #define substitutes a with 20 leaving no identifier and hence compilation error.
    Complilation Error: expected identifier or '(' before numeric constant


Be The First To Comment