Monday, June 18, 2012

To demonstrate working of Enumerated Data Type


/* Program to demonstrate working of Enumerated Data Type */

#include<stdio.h>

#include<conio.h>

void main()

{

  int i;

  enum month {JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC};

  clrscr();

  for(i=JAN;i<=DEC;i++)

    printf("\n%d",i);

  getch();

}

 

OUTPUT

 

0

1

2

3

4

5

6

7

8

9

10

11

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.