Enumarated Data Types

Enumerated data type variables can only assume values which have been previously declared.

        enum month { jan = 1, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec };
        enum month this_month;
        this_month = feb;
 In the above declaration,month is declared as an enumerated data type. 
It consists of a set of values, jan to dec.
 Numerically, jan is given the value 1, feb the value 2, and so on.
Back