
400 Programming and Data Structures
Q m r uT;
Name : Sachin
Result: 1
Grade : 2
Explanation The above program is same as previous one. Only the member variables and bits
assigned are different.
12.10 ENUMERATED DATA TYPE
The enum is a keyword. It is used for declaring enumeration types. The programmer can create his/
her own data type and define what values the variables of these data types can hold. This enumeration
data type helps in reading the program.
Consider the example of 12 months of a year.
enum month {Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec};
This statement creates a user-defined data type. The keyw ...