ProAnswers.org

Write a C program to create enumerated data type for 12 months. Display their values in integer constants ?

 #include<stdio.h>

#include<conio.h>

void main()

{

Enum month{Jan, Feb, mar, Apr, May, June, July, Aug, Sep, Oct, Nov, Dec}

clrscr();

printf(“\n Jan=%d”, Jan);

printf(“\n Feb=%d”, Feb);

printf(“\n June=%d”, June);

printf(“\n Dec=%d”, Dec);

getch();

}

Output:

Jan=0

Feb=1

June=5

Dec=11