namespace AsciiDevideCasting
static void Main(string[] args)
for (int i = 0; i < 255; i++)
Console.Write((char)i + " = " + i + " ");
Console.WriteLine("devision examples begin");
Console.WriteLine("devision of two integers examples:");
Console.WriteLine("the int result of 5/2 is {0}", result1);
Console.WriteLine("the double result of 5/2 is {0}", result2);
double average = (grade1 + grade2) / 2;
Console.WriteLine("the average of the grades 99 and 100 is " + average);
Console.WriteLine("devision with double examples:");
double result3 = 5.0 / 2;
Console.WriteLine("the result of 5.0/2 is {0}", result3);
result3 = (100 + 92 + 85 + 96) / 4.0;
Console.WriteLine("the result of (100+92+85+96)/4.0 is {0}", result3);
Console.WriteLine("devision examples end");
Console.WriteLine("casting examples begin");
Console.WriteLine("the integer cast of {0} is {1}", pi, casted);
Console.WriteLine("the char for the int value {0} is {1}", charValue1, (char)charValue1);
Console.WriteLine("the char for the int value {0} is {1}", charValue1, (char)charValue1);
double charValue2 = 102.5;
Console.WriteLine("the char for the double value {0} is {1}", charValue2, (char)charValue2);
Console.WriteLine("the char for the double value {0} is {1}", charValue2, (char)charValue2);
Console.WriteLine("the result of (double)5/2 is {0}", result2);
average = (double)(grade1 + grade2) / 2;
Console.WriteLine("with casting, the average of the grades 99 and 100 is " + average);
average = (grade1 + grade2) / (double)2;
Console.WriteLine("with casting2, the average of the grades 99 and 100 is " + average);
Console.WriteLine("casting examples end");