1)

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

static void Main(string[] args)
{
const int x = 10;
const int y = 20;
for (int i = 1; i <= 5; i++)
{
x = x * i;
y = y * i;
}
Console.WriteLine(x);
Console.WriteLine(y);
Console.ReadLine();
}


A) 1200, 2400

B) Compile time error

C) 2400, 1200

D) 12, 24

Answer:

Option B

Explanation:

The left hand side of an assignment must be a variable, property or indexer i.e for both ‘x’ and ‘y’