What will be the output of the following C# code?
static void Main(string[] args)
{
int a, b, c, x;
a = 80;
b = 15;
c = 2;
x = a - b / (3 * c) * ( a + c);
Console.WriteLine(x);
Console.ReadLine();
}
static void Main(string[] args)
{
int a, b, c, x;
a = 80;
b = 15;
c = 2;
x = a - b / (3 * c) * ( a + c);
Console.WriteLine(x);
Console.ReadLine();
}
A. 78
B. -84
C. 80
D. 98
Answer: Option B
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