Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. Whats is the output of this C code?

    void main()
    {
    int const k = 11;
    k++;
    printf("k is %d", k);
    }
  2. A.
    k is 12
    B.
    Error because const and int are used together
    C.
    garbage value
    D.
    Error, because a constant variable cannot be changed

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    Constant variable has to be declared and defined at the same time. Trying to change it later results in error.


Be The First To Comment