Answer (Choose 1 answer)
7
class A{
public int GetNumber(){
return 6;
}
} class B: A{
public void Calc(ref int s) {
for (int i = 1; i <= GetNumber(); i += 3)
s += i;
}
} class Program {
static void Main(string[] args) {
int s = 0;
B obj = new B();
obj.Calc(ref s);
Console.WriteLine(--s);
}
} The output will be:
A. 4
B. 5
C 3
D. 2