PRN211_-_SP_2023_-_FE_167.webp
hirosi212

PRN211_-_SP_2023_-_FE_167.webp

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

Thông tin

Category
PRN211
Thêm bởi
hirosi212
Ngày thêm
Lượt xem
1,739
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom