In this tutorial, we are going to write a C Program to display months using the enum in C Programming with practical program code and step-by-step full complete explanation.


C Program

 
#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\n",Jan);
	printf("Feb=%d\n",Feb);
	printf("Mar=%d\n",Mar);
	printf("Apr=%d\n",Apr);
	printf("May=%d\n",May);
	printf("June=%d\n",June);
	printf("July=%d\n",July);
	printf("Aug=%d\n",Aug);
	printf("Sep=%d\n",Sep);
	printf("Oct=%d\n",Oct);
	printf("Nov=%d\n",Nov);
	printf("Dec=%d\n",Dec);

	getch();
}


Output

 
Jan=0
Feb=1
Mar=2
Apr=3
May=4
June=5
July=6
Aug=7
Sep=8
Oct=9
Nov=10
Dec=11