Write a program that prompts the user for one of four colours. Based on their input, provide back an interesting response.
using System;
using System.Collections.Generic;
namespace App
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter color: ");
string color = Console.ReadLine();
if (color == "red") {
Console.WriteLine("Power");
}
else if (color == "blue")
{
Console.WriteLine("Cold");
}
else if (color == "green")
{
Console.WriteLine("Earth");
}
else if (color == "orange")
{
Console.WriteLine("Health");
}
else {
Console.WriteLine("Wrong color");
}
Console.ReadLine();
}
}
}
Comments
Leave a comment