What will be the output of the following C# code?
static void Main(string[] args)
{
int a = 4, b = 5, c = 7, u = 9;
int h;
h = (Convert.ToInt32(u < b)) + (a + b--) + 2;
Console.WriteLine(h);
Console.WriteLine(b);
Console.WriteLine(u < b);
}
static void Main(string[] args)
{
int a = 4, b = 5, c = 7, u = 9;
int h;
h = (Convert.ToInt32(u < b)) + (a + b--) + 2;
Console.WriteLine(h);
Console.WriteLine(b);
Console.WriteLine(u < b);
}
A. 12, 5, 0
B. 11, 4, False
C. 11, 5, 0
D. 12, 4, False
Answer: Option B
Related Questions on Operators and Expressions in C Sharp
What does the modulus operator (%) do in C#?
A. Increments the operand by 1
B. Returns the quotient of a division
C. Performs multiplication
D. Returns the remainder of a division
Join The Discussion