C# Program to Print ASCII Value

Introduction

C# Program to Print ASCII Value. 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

C# Program to Print ASCII Value
C# Program to Print ASCII Value

Leave a Comment