Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace switchCase
- {
- class MainClass
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Enter Colour Of Trafic Light");
- string colour = Console.ReadLine();
- switch (colour)
- {
- case "Green":
- {
- Console.WriteLine("This is a green trafic light");
- break;
- }
- case "Yellow":
- {
- Console.WriteLine("This is a yellow light");
- break;
- }
- case "Red":
- {
- Console.WriteLine("This is a Red light");
- break;
- }
- default:
- {
- Console.WriteLine(" This is not a trafic light ");
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement