What will be the output of the following C# code?
static void Main(string[] args)
{
int a = 5, b = 10;
if (Convert.ToBoolean(Convert.ToInt32(++a)) || Convert.ToBoolean(Convert.ToInt32(++b)))
{
Console.WriteLine(a + "\n" + b);
}
else
Console.WriteLine(" C# ");
}
static void Main(string[] args)
{
int a = 5, b = 10;
if (Convert.ToBoolean(Convert.ToInt32(++a)) || Convert.ToBoolean(Convert.ToInt32(++b)))
{
Console.WriteLine(a + "\n" + b);
}
else
Console.WriteLine(" C# ");
}A. 6 11
B. 6 16
C. 6 12
D. 6 10
Answer: Option D

Join The Discussion