1 /* enum.c -- uses enumerated values */ 2 #include <stdio.h> 3 #include <string.h> // for strcmp() 4 #include <stdbool.h> // C99 feature 5 6 enum spectrum {red, orange, yellow, green, blue, violet}; 7 const char * colors[] = {"red", "orange", "yellow", 8 "green", "blue", "violet"}; 9 #define LEN 30 10 11 int main(void) 12 { 13 char choice[LEN]; 14 enum spectrum color; 15 bool color_is_found = false; 16 17 puts("Enter a color (empty line to quit):"); 18 while (gets(choice) != NULL && choice[0] != '