CSharp examples for Language Basics:Console
Choose action via console input
using System;/*from www . j a v a2 s .c o m*/ class ChooseAction { public static void Main() { string choice; Console.Write("Enter either A, B or C: "); choice = Console.ReadLine(); if(choice == "A") Console.WriteLine("You entered an A"); else if (choice == "B") Console.WriteLine("You entered a B"); else Console.WriteLine("You entered a C"); //unsound } }