Advertisement
MarinParov

IF STATEMENT NUMBERS WRITTEN WITH LETTERS

Feb 16th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _7._4_Write_numbers_with_letters
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int num = int.Parse(Console.ReadLine());
  14.             string one = "one";
  15.             string two = "two";
  16.             string three = "three";
  17.             string four = "four";
  18.             string five = "five";
  19.             string six = "six";
  20.             string seven = "seven";
  21.             string eight = "eight";
  22.             string nine = "nine";
  23.             string ten = "ten";
  24.             if (num == 1)
  25.             {
  26.                 Console.WriteLine(one);
  27.             }
  28.              else if (num == 2)
  29.             {
  30.                 Console.WriteLine(two);
  31.             }
  32.             else if (num == 3)
  33.             {
  34.                 Console.WriteLine(three);
  35.             }
  36.             else if (num == 4)
  37.             {
  38.                 Console.WriteLine(four);
  39.             }
  40.             else if (num == 5)
  41.             {
  42.                 Console.WriteLine(five);
  43.             }
  44.             else if (num == 6)
  45.             {
  46.                 Console.WriteLine(six);
  47.             }
  48.             else if (num == 7)
  49.             {
  50.                 Console.WriteLine(seven);
  51.             }
  52.             else if (num == 8)
  53.             {
  54.                 Console.WriteLine(eight);
  55.             }
  56.             else if (num == 9)
  57.             {
  58.                 Console.WriteLine(nine);
  59.             }
  60.             else if (num == 10)
  61.             {
  62.                 Console.WriteLine(ten);
  63.             }
  64.             else
  65.             {
  66.                 Console.WriteLine("Number too big");
  67.             }
  68.            
  69.  
  70.         }
  71.  
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement