Ask Question

What is the value of this expression?

(int) blue

refer to data type color_t

typedef enum

{

red, orange, yellow, green, blue

}

color_t;

A. 0

B. 1

C. 4

D. 5

+5
Answers (1)
  1. 8 January, 13:23
    0
    C. 4

    Explanation:

    typedef enum{

    red, orange, yellow, green, blue

    }

    color_t;

    defines an enumeration type color_t with the values red, orange, yellow, green, blue.

    If we print out the values of these individual elements they will be as follows:

    red : 0

    orange : 1

    yellow: 2

    green: 3

    blue: 4

    Note that the integer values are dependent on the position in the definition.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What is the value of this expression? (int) blue refer to data type color_t typedef enum { red, orange, yellow, green, blue } color_t; A. 0 ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers