#include int main(void) { char colour; /* ask user for colour */ printf ("Enter the colour of the light (R, G or Y): "); scanf ("%c", &colour); /* test if colour is red */ if (colour == 'r' || colour == 'R') printf ("STOP! \n"); else if (colour == 'y' || colour == 'Y') /* yellow colour test */ printf ("CAUTION! \n"); else if (colour == 'g' || colour == 'G') /* green colour test */ printf ("GO! \n"); else /* if not Y or G or R then invalid colour */ printf ("INVALID COLOUR! \n"); return(0); }