What's mistake in my program I just want to do it , if some one enter specific color then print specific statement for each color
outputCode:#include <stdio.h> int main(void) { unsigned char favorite_color; printf("Please choose your favorite color: "); scanf("%d", &favorite_color); /* print out the result */ switch (favorite_color) { case red: printf("your favorite color is Red"); break; case green: printf("your favorite color is Green"); break; case blue: printf("your favorite color is Blue"); break; default: printf("you did not choose any color"); } return 0; }
hello.c: In function 'main':
hello.c:14:10: error: 'red' undeclared (first use in this function)
case red:
^~~
hello.c:14:10: note: each undeclared identifier is reported only once for each function it appears in
hello.c:17:10: error: 'green' undeclared (first use in this function)
case green:
^~~~~
hello.c:20:10: error: 'blue' undeclared (first use in this function)
case blue:
^~~~