โ Back to If Statements
Question 382
Traffic Light Action
Traffic Light Action
Read a single character representing a traffic light color:R,Y, orG. Print the action a driver should take: -R->Stop-Y->Slow down-G->GoFor example, given the inputR, the program prints: Stop
Expected Output:
Stop
Topics:
If Statements
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.