1)

Predit the ouput of the following 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(" Values are different");
}
else 
{
Console.WriteLine("Values are same");
}
Console.ReadLine();
}


A) Values are different

B) Values are same

C) Since both have equal values, no conclusion

D) None of the mentioned

Answer:

Option A

Explanation:

Solving the expression according to the priority of operators, we will ge the values of  a and b are 40 and 240 respectively.

So the correct answer is option a i.e Values are different