PRN211_-_REB5_-_FA_2023_1324.webp
B

PRN211_-_REB5_-_FA_2023_1324.webp

(Choose 1 answer)
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:
A. 10
B. 0
C. 6
D. An exception will be thrown

Exit 37

Thông tin

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

Image metadata

Filename
PRN211_-_REB5_-_FA_2023_1324.webp
File size
53.3 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom