/******************************************************************************
Online C# Compiler.
Code, Compile, Run and Debug C# program online.
Write your code in this editor and press "Run" button to execute it.
*******************************************************************************/
using System;
class HelloWorld {
static void tes001()
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("Please enter a char:");
char ch = char.Parse(Console.ReadLine());
int n = (int)ch;
int n1 = n - 1;
char ch1 = (char)n1;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("ch1:" + ch1);
int n2 = n + 1;
char ch2 = (char)n2;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ch2:" + ch2);
Console.ReadKey();
}
static void tes002()
{
//Cap -> small
Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("Please enter a char:");
char ch = char.Parse(Console.ReadLine());
int n = (int)ch;
int n1 = n - 32;
char ch1 = (char)n1;
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("ch1:" + ch1);
int n2 = n1 + 1;
char ch2 = (char)n2;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("ch2:" + ch2);
Console.ReadKey();
}
static void Main() {
Console.WriteLine("Hello World");
tes001();
tes002();
}
}