Char
using System;
public class TestChar
{
static void Main(String[] args)
{
char ch1 = 'M', ch2;
Console.WriteLine("Character is : " + ch1);
ch1 = (char)88; // 88 is the ASCII code for X
ch2 = 'Y';
Console.WriteLine("ch1 and ch2: ");
Console.WriteLine(ch1 + " " + ch2);
ch1++; // increment ch1
Console.WriteLine("ch1 is now " + ch1);
Console.ReadLine();
}
}
Output:
Character is : M
ch1 and ch2:
X Y
ch1 is now Y