What will be the output of the following C++ code? #include <iostream> using namespace std; enum colour {green, red, blue, white, yellow, pink}; int main() { cout << green << red << blue << white << yellow << pink; return 0; }
Added by Domingo F.
Step 1
An enum (short for enumeration) is a user-defined type consisting of a set of named integral constants. In C++, the first name in an enum has a default value of 0, and each subsequent name has a value one greater than the previous name unless explicitly defined Show more…
Show all steps
Your feedback will help us improve your experience
Pritesh Ranjan and 74 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD