Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 4;
    int b = 5;
    int c = 6;
    int d = 8;
    if (((a * b / c) + d) >= ((b * c + d ) / a))
    {
        Console.WriteLine("Line 1 - a is greater to b");
        Console.WriteLine((a * b / c) + d);
    }
    else
    {
        Console.WriteLine("Line 1 - a is not greater to b");
        Console.WriteLine((b * c + d )/ a);
    }
}

A. "Line 1 - a is greater to b"
11

B. "Line 1 - a is not greater to b"
9

C. Both are equal

D. None of the mentioned

Answer: Option A


Join The Discussion

Related Questions on Operators and Expressions in C Sharp