Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    const int a;
    a = 32;
    printf("a is %d", a);
    return 0;
    }
  2. A.
    a is 32
    B.
    Compile time error
    C.
    Run time error
    D.
    none

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Since the constant variable has to be declared and defined at the same time, not doing it results in an error.


Be The First To Comment