C Programming - Typedef - Discussion

Discussion Forum : Typedef - Find Output of Program (Q.No. 1)
1.
What will be the output of the program?
#include<stdio.h>

int main()
{
    enum color{red, green, blue};
    typedef enum color mycolor;
    mycolor m = red;
    printf("%d", m);
    return 0;
}
1
0
2
red
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Noobie said:   8 years ago
How to print red in this program? Can anyone explain it?

Harshini said:   7 years ago
Here enum is same as an array but it considers only the integer values.


Post your comments here:

Your comments will be displayed after verification.