Quote Originally Posted by laserlight View Post
You probably just want to declare TrafficLight as a char here and not bother with the enum.
Program only except integer value so why it doesn't except character input

Code:
#include<stdio.h>

int main (void)


{
	enum colour {R, G, Y}TrafficLight;
	
	scanf("%d", TrafficLight);
	
	switch(TrafficLight)
	{
		case R: 
		        printf("Red Light\n");
				break;
		case G:  
		       printf("Green Light \n");
			   break;
		case Y:  
		       printf("Yellow Light\n");
			   break;
        default:
               printf("Light OFF \n");				   
               break;			   
	}
	
	return 0;
	
}