2
(Choose 1 answer)
A. 0
B. 6
C. An exception will be thrown
D. 10
}
}
record A {
(int x, int y) values = (0, 0);
public A(int x, int y) => values = (x, y);public void Print(){
var r = Sum(values.x, values.y);
Console.WriteLine("{r}");
int Sum(int a, int b){var s = 0;
for (int i = a; i < b; i++){
s += i;
}
return s;
}
class Program{
static void Main(string[] args){A obj = new A(1,5);
obj.Print();
}
The output will be:
Finish