1
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



2.

Correct order of priorities are :


A) ‘/’ > ‘%’ > ‘*’ > ‘+’

B) ‘/’ > ‘*’ > ‘%’ > ‘+’

C) ‘*’ > ‘/’ > ‘%’ > ‘+’

D) ‘%’ > ‘*’ > ‘/’ > ‘+’



3.

What will the output of the following set of code?

static void Main(string[] args)
{
int a, b, c, x;
a = 80;
b = 10;
c = 3;
x = a - b / 3 + c * 2 - 1;
Console.WriteLine(x);
Console.ReadLine();
}


A) 84

B) 82

C) 90

D) 80



4.

What will be the output of the following set of code?

static void Main(string[] args)
{
float a = 20.4f;
int b = 15;
float c;
c = a * (b + a) / (a - b);
Console.WriteLine("result is :" + c);
Console.ReadLine();
}


A) 133.7333

B) 132.7333

C) 135.7333

D) 133.76



1