This is a simple C# program to convert number in characters. If you are a c# beginner or want to start learning the c# programming language, then this program will help you to understand the basics of c# programming. In this program, I will explain how to write a c# program to convert the number into characters.
Copy the below c# program and execute it in your Microsoft Visual Studio IDE (Integrated Development Environment ). At the end of this program, I have shared the output of program this program.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | using System; public class ConversionExample { public static void Main(string[] args) { int n,sum=0,r; Console.Write("Enter the Number= "); n= int.Parse(Console.ReadLine()); while(n>0) { r=n%10; sum=sum*10+r; n=n/10; } n=sum; while(n>0) { r=n%10; switch(r) { case 1: Console.Write("one "); break; case 2: Console.Write("two "); break; case 3: Console.Write("three "); break; case 4: Console.Write("four "); break; case 5: Console.Write("five "); break; case 6: Console.Write("six "); break; case 7: Console.Write("seven "); break; case 8: Console.Write("eight "); break; case 9: Console.Write("nine "); break; case 0: Console.Write("zero "); break; default: Console.Write("tttt "); break; } n=n/10; } } } |
Enter the Number= 78546
seven eight five four six
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: c program with output, c programs, c# - How To Convert A Number To an ASCII Character, C# Program to Convert Digits to Words, c# program with example, how to convert number into words in C#, Number to Word Application in C#