print out a number of characters and their numbers - CSharp Language Basics

CSharp examples for Language Basics:char

Description

print out a number of characters and their numbers

Demo Code



using System;//from w  w w . j av a  2  s. c o  m

class chars
{
   public static void Main()
   {
       int ctr;
       char ch;

       Console.WriteLine("\nNumber   Value\n");

       for( ctr = 60; ctr <= 95; ctr = ctr + 1)
       {
           ch = (char) ctr;
           Console.WriteLine( "{0} is {1}", ctr, ch);
       }
   }
}

Result


Related Tutorials