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

/* 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(“Jan=%d”, Jan);
printf(“Feb=%d”, Feb);
printf(“June=%d”, June);
printf(“Dec=%d”, Dec);
}

Output:
======
Jan =0
Feb=1
June=5
Dec=11

No comments: