C++ output type question

Q.  Trace the output

enumcolour {  green, red, blue=10, white, yellow, pink    };

int main()
    {
cout << green << " ," << red << " ," << blue << " ," << white << " ," << yellow << " ," << pink;
return 0;
    }

- Published on 17 Jun 15

a. 10, 11, 12, 13
b. 8, 9, 10, 11, 12, 13
c. 0, 1, 10, 11, 12, 13
d. None of the above

ANSWER: 0, 1, 10, 11, 12, 13

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)