using System;
class Program
{
static void Main()
{
//converting char to int
int i;
Console.WriteLine("Enter any Number:");
i = int.Parse(Console.ReadLine());
char c = Convert.ToChar(i);
Console.WriteLine(c);
Console.ReadLine();
//converting int to char
char k;
Console.WriteLine("Enter any Char:");
k = char.Parse(Console.ReadLine());
int m = Convert.ToInt32(k);
Console.WriteLine(m);
Console.ReadLine();
}
}
class Program
{
static void Main()
{
//converting char to int
int i;
Console.WriteLine("Enter any Number:");
i = int.Parse(Console.ReadLine());
char c = Convert.ToChar(i);
Console.WriteLine(c);
Console.ReadLine();
//converting int to char
char k;
Console.WriteLine("Enter any Char:");
k = char.Parse(Console.ReadLine());
int m = Convert.ToInt32(k);
Console.WriteLine(m);
Console.ReadLine();
}
}
output |
No comments:
Post a Comment