ENUMERATION

1.Enum is a collection of named integer constant means it's each element is assigned by integer value 

2.It is declared with enum keyboard 


#include<stdio.h>
enum age
{
Rocky=21,
Varsha=19,
Afshana=18,
Neeraj=23,
Vandana=24,
Jyoti=16
};
int main()
{
enum age obj;
obj=Vandana;
/*age of vandana=24*/
printf("The age of Vandana is %d",obj);
}
•Output 

Age of vandana=24

Comments

Popular posts from this blog

Java vs C++

STRUCTURE

SWITCH PROGRAMME