Answer (Choose 1 answer)
What is the output of the following code?
class Test
{
int x, y;
public Test() { x = 1; y = 5; }
public int Sum() {
int s = 0;
for (int i = x; i <= y; i++)
{
}
s += i;
return s;
} static void Main(string[] args){
Test obj = new Test();
Console.WriteLine(obj.Sum());
}
}
A. 15
B. 10
C. 16
D. 11
Elt