A

Admin • 833K Points
Coach

Q. Which of the following is the correct way to define an enumeration in C++?

  • (A) enum MyEnum { RED, GREEN, BLUE };
  • (B) struct MyEnum { RED, GREEN, BLUE };
  • (C) class MyEnum { RED, GREEN, BLUE };
  • (D) None of the above
  • Correct Answer - Option(A)
  • Views: 25
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

The correct way to define an enumeration is 'enum MyEnum { RED, GREEN, BLUE };'.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.