Convert One Digit to English - CSharp System

CSharp examples for System:Math Number

Description

Convert One Digit to English

Demo Code


using System.Collections.Generic;

public class Main{
        private static string ConvertOneDigit(int Number)
        {//from w  ww. j  a v  a 2s .c o m
            switch (Number)
            {
                case 0:
                    return "Zero";
                case 1:
                    return "One";
                case 2:
                    return "Two";
                case 3:
                    return "Three";
                case 4:
                    return "Four";
                case 5:
                    return "Five";
                case 6:
                    return "Six";
                case 7:
                    return "Seven";
                case 8:
                    return "Eight";
                case 9:
                    return "Nine";
                default:
                    return "ERROR";
            }
        }
}

Related Tutorials