I am surprised by the output of the following code
public static void Main(string[] args)
{
char x = 'A';
int i = 0;
Console.WriteLine (true ? x : 0);
Console.WriteLine(false ? i : x);
}
When I was reading the C# interview question I saw this code and the output of above code was
Output
65
65
I am wondering how does that happen.
Can anybody explain me ? Thanks!