What will be the output of the following C# code?
static void Main(string[] args)
{
int m = 10, n = 5, p = 20;
bool b1 = m * p / n <= p * n / m ;
int l = p - 2 * m;
bool b2 = l == 0;
int z = Convert.ToInt32(b2);
int k = Convert.ToInt32(b1);
Console.WriteLine(k);
Console.WriteLine(z);
}
static void Main(string[] args)
{
int m = 10, n = 5, p = 20;
bool b1 = m * p / n <= p * n / m ;
int l = p - 2 * m;
bool b2 = l == 0;
int z = Convert.ToInt32(b2);
int k = Convert.ToInt32(b1);
Console.WriteLine(k);
Console.WriteLine(z);
}
A. 0 0
B. 1 0
C. 0 1
D. 1 1
Answer: Option C
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