// Pantea Aria // Enum // Imagine you are working in a coffee shop ordering system. // We can make a type for coffee sizes with limited values, size_type // (instead of using characters like 'S', 'M', 'L'). // // enum size_type {SMALL, MEDIUM, LARGE}; // 0 for SMALL // 1 for MEDIUM // 2 for LARGE // Write a program that declares a variable of type enum coffee // and assigns it the value LARGE. Then, print the value. #include enum coffee {SMALL, MEDIUM, LARGE}; int main(void) { // get memory for your coffee // declare a var of type enum coffee enum coffee my_coffee; my_coffee = LARGE; // my_coffee = 2; if (my_coffee == LARGE) { printf ("the size of my coffe is Large\n"); } else if (my_coffee == SMALL) { printf ("the size of my coffe is Small\n"); } else { printf ("the size of my coffe is Medium\n"); } return 0; }