I came across the below lines of code recently.
public class Program
{
public static void Main(string[] args)
{
char x = 'X';
int i = 0;
Console.WriteLine (true ? x : 0);
Console.WriteLine(false ? i : x);
}
}
As per my knowledge, the above code should output the character 'X' in both the cases; However, I got 88 in the console when I execute the code; Can anyone help me understand why the output is ASCII code and not the character?