CS_0006_Condition3
Result:
Please enter your choice 1 or 2 or 3
2
You have entered 2, so you won BIKE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Condition3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Please enter
your choice 1 or 2 or 3");
string userValue = Console.ReadLine();
string message = (userValue == "1") ? "CAR" : "BIKE";
Console.WriteLine("You have
entered {0}, so you won {1}",
userValue, message);
Console.ReadLine();
}
}
}
Comments
Post a Comment