Skip to content

Instantly share code, notes, and snippets.

@SmileyVi
Created January 21, 2015 10:39
Show Gist options
  • Save SmileyVi/ac6ef43549d14aaae552 to your computer and use it in GitHub Desktop.
Save SmileyVi/ac6ef43549d14aaae552 to your computer and use it in GitHub Desktop.
DigitsAsWords
using System;
class DigitAsWords
{
static void Main()
{
Console.WriteLine("Enter digit (0 to 9): ");
int a = int.Parse(Console.ReadLine());
switch (a)
{
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("Not a digit!"); break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment