Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C# code conversion?
static void Main(string[] args)
{
char a = ‘A’;
string b = “a”;
Console.WriteLine(Convert.ToInt32(a));
Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));
Console.ReadLine();
}

What will be the output of the following C# code conversion?
static void Main(string[] args)
{
char a = ‘A’;
string b = “a”;
Console.WriteLine(Convert.ToInt32(a));
Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));
Console.ReadLine();
}
a) 1, 97
b) 15, 97
c) 65, 97
d) 97, 1

Answer: c
Explanation: ASCII value of character ‘a’ is 65 and ASCII value of string “a” is 97.

Join The Discussion