using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int num, unit, ten;
            Console.Write("\t\t\t** Developed by : GE ** \n\n ");
            Console.Write("Enter number here in range 0-50 : ");
            num = Convert.ToInt16(Console.ReadLine());
            unit = num % 10;
            ten = num / 10;
            Console.Write("You entered : ");
            if (num > 50)
            {
                Console.WriteLine("Error (Number out of Range) ");
            }

            else if (num >= 10 && num <= 19)
            {
                switch (num)
                {
                    case 10:
                        Console.WriteLine("Ten = " + num);
                        break;
                    case 11:
                        Console.WriteLine("Eleven = " + num);
                        break;
                    case 12:
                        Console.WriteLine("Twelve = " + num);
                        break;
                    case 13:
                        Console.WriteLine("Thirteen = " + num);
                        break;
                    case 14:
                        Console.WriteLine("Fourteen = " + num);
                        break;
                    case 15:
                        Console.WriteLine("Fifteen = " + num);
                        break;
                    case 16:
                        Console.WriteLine("Sixteen = " + num);
                        break;
                    case 17:
                        Console.WriteLine("Seventeen = " + num);
                        break;
                    case 18:
                        Console.WriteLine("Eighteen = " + num);
                        break;
                    case 19:
                        Console.WriteLine("Nineteen = " + num);
                        break;


                }
            }
            else if (num >= 20 && num <= 50)
            {
                switch (ten)
                {
                    case 2:
                        Console.Write("Twenty");
                        break;
                    case 3:
                        Console.Write("Thirty");
                        break;
                    case 4:
                        Console.Write("Fourty");
                        break;
                    case 5:
                        Console.Write("Fifty");
                        break;

                }
                switch (unit)
                {

                    case 0:
                        Console.WriteLine("  ");
                        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;

                }
            }
            else if (num >= 0 && num <= 9)
            {
                switch (num)
                {
                    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;

                }
            }
            Console.ReadLine();
        }
    }
}

With a little help from Linq, you can reduce the number of lines of code.

using System;
using System.Collections.Generic;
using System.Linq;

namespace DW_371861
{
   class Program
   {
      static void Main(string[] args)
      {
         Console.Write("\t\t\t** Developed by : GE **\n\n" +
            " Enter number here in range 0-50 : ");
         string strInput = Console.ReadLine();
         int intInput = 0;

         IEnumerable<int> ieRange = Enumerable.Range(0, 51);
         if (!int.TryParse(strInput, out intInput) || (!Enumerable.Range(0, 51).Contains(intInput)))
         {
            Console.WriteLine("Could not convert the value ({0:G}) to a suitable number", intInput);
            return;
         }

         if (Enumerable.Range(10, 10).Contains(intInput))
         {
            List<string> lst_strTeens = new List<string>()
            {
               "ten", "eleven", "twelve", "thirteen", "fourteen",
               "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"
            };

            Console.WriteLine(lst_strTeens[intInput - 10] + "=" + intInput);
            return;
         }

         List<string> lst_strOnes = new List<string>()
         {
            "zero", "one", "two", "three", "four", "five",
            "six", "seven", "eight", "nine"
         };

         if(Enumerable.Range(0,10).Contains(intInput))
         {
            Console.WriteLine(lst_strOnes[intInput] + "=" + intInput);
            return;
         }

         strInput = intInput.ToString(); //Ensurance of format
         string strOutput = new List<string>
         {
            null, "ten", "twenty", "thirty", "forty", "fifty"
         }[int.Parse(strInput[0].ToString())];

         int intOnes = int.Parse(strInput[1].ToString());
         if ((0).Equals(intOnes))
         {
            Console.WriteLine(strOutput + '=' + intInput);
            return;
         }

         Console.WriteLine(strOutput + '-' + lst_strOnes[intOnes] +'=' + intInput);
      }
   }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.