#include <stdio.h>
int
main (void)
{
char color;
printf ("Enter the color of the light (R,G,Y,A): ");
scanf ("%c", &color);
switch (color)
{
case 'R':
case 'r':
printf ("STOP! \n");
break;
case 'Y':
case 'y':
case 'A':
case 'a':
printf ("CAUTION! \n");
break;
case 'G':
case 'g':
printf ("GO! \n");
break;
default:
printf ("The color is not valid.\n");
}
return (0);
}
Enter the color of the light (R,G,Y,A): G
GO!