Q. What is the output of the following code?
Code:
enum color {RED, GREEN, BLUE};
int main() {
enum color c = GREEN;
printf("%d", c);
}
β
Correct Answer: (A)
1
Explanation: Enums start at 0 by default, so GREEN is 1.