Skip to content

Instantly share code, notes, and snippets.

@Brianceasar
Created November 30, 2022 06:35
Show Gist options
  • Save Brianceasar/ef1c4f95d5880f37f70a588e953e2fc6 to your computer and use it in GitHub Desktop.
Save Brianceasar/ef1c4f95d5880f37f70a588e953e2fc6 to your computer and use it in GitHub Desktop.
A program that asks for a digit (0-9), and depending on the input, shows the digit as a word (in English)
class Program
{
static void Main(string[] args)
{
Console.Write("Enter a number: ");
int number = Int32.Parse(Console.ReadLine());
switch (number)
{
case 0: Console.WriteLine("Zero"); break;
case 1: Console.WriteLine("One"); break;
case 2: Console.WriteLine("Two"); break;
case 3: Console.WriteLine("Three"); break;
case 4: Console.WriteLine("Four"); break;
case 5: Console.WriteLine("Five"); break;
case 6: Console.WriteLine("Six"); break;
case 7: Console.WriteLine("Seven"); break;
case 8: Console.WriteLine("Eight"); break;
case 9: Console.WriteLine("Nine"); break;
default: Console.WriteLine("Wrong input"); break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment