Q:

C# Program to Print ASCII Value

0

C# Program to Print ASCII Value

 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

This program is compiled and tested on a Visual Studio 2012..

using System;

namespace TechStudyCSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            char c;            
            Console.WriteLine("Enter a character: ");
            c = Convert.ToChar( Console.ReadLine());            
            Console.WriteLine("\nASCII Value of " +c+" "+  Convert.ToInt32(c));          
            Console.ReadKey();
        }
    }
}

Result:

Enter a character: 

a

ASCII Value of a 97

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C# Program to Calculate Area of Circle... >>
<< C# Program to find the Size of data types...