Created
November 30, 2022 06:35
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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