Home / CSE MCQs / C-MCQs :: Discussion

Discussion :: C-MCQs

  1. What is the output of this C code?

    int main()
    {
    enum {ORANGE = 12, MANGO, BANANA = 11, APPLE};
    printf("APPLE = %d\n", APPLE);
    }
  2. A.
    APPLE= 11
    B.
    APPLE= 12
    C.
    APPLE= 23
    D.
    APPLE= 0

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    In enum, the value of constant is defined to the recent assignment from left.


Be The First To Comment