PRN211_-_REB5_-_FA_2023_1324.webp
B

PRN211_-_REB5_-_FA_2023_1324.webp

OD
(Choose 1 answer)
class A { (
int x, int y) values = (0, 0);
public A(int x, int y) => values = (x, y);public void Print(){
var r = Sum();
Console.WriteLine($"{r}");
int Sum(){
var s = 0;
for (int i = values.x; i < values.y; i++){
s += (i&1)==1?i:0;
}
return s;
}
}
}
class Program{
Main(string[] args){
static void A obj = new A(2,8);
obj.Print();
} }
The output will be:
A. 15
B. 0
C. 10
D. 12

Exit 15

Thông tin

Category
PRN211
Thêm bởi
bright_fortune
Ngày thêm
Lượt xem
1,016
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
52.6 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom