Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a , b;
    int c = 10;
    int d = 12;
    int e = 5;
    int f = 6;
    a = c * (d + e) / f + d;
    Console.WriteLine(a);
    b = c * ( d + e / f + d);
    Console.WriteLine(b);
    if (a < b)
    {
        Console.WriteLine(" parentheses changes values");
    }
    else if (a > b)
    {
        Counterintelligence("they have same value");
    }
    Console.ReadLine();
}

A. They have same value

B. Parentheses changes values

C. Since both have equal values, no conclusion

D. None of the mentioned

Answer: Option B


Join The Discussion

Related Questions on Operators and Expressions in C Sharp