07-25-2023, 01:25 PM
Enumerations define a set of named constants.
enum Color {
RED,
GREEN,
BLUE
};
int main() {
enum Color color = GREEN;
if (color == GREEN) {
printf("Color is Green\n");
}
return 0;
}
enum Color {
RED,
GREEN,
BLUE
};
int main() {
enum Color color = GREEN;
if (color == GREEN) {
printf("Color is Green\n");
}
return 0;
}