232k views
5 votes
TRUE/FALSE. given the following decaration: enum tree { oak, maple, pine }; what is the value of the following relational expression? oak > pine

1 Answer

0 votes

Answer:

The answer is false.

Step-by-step explanation:

In C++ and C, when you create an enumeration, the default values assigned to the enumerators are integers starting from 0, in the order they are declared. In the given declaration:

enum tree { oak, maple, pine };

The values assigned are:

  1. oak: 0
  2. maple: 1
  3. pine: 2

The relational expression 'oak > pine' compares 0 to 2, which is false, so the answer is false.

User Waqas Mumtaz
by
7.2k points