P208. WAP to understand ENUM.

 #include<stdio.h>

enum color

{

        red=1,

        green,

        blue,

};

void main()

{

        enum color current_color = red;

        printf("Value of red = %d\n",current_color);

 

        current_color = green;

        printf("Value of green = %d\n",current_color);

 

        current_color = blue;

        printf("Value of blue = %d\n",current_color);

}

Comments