PRN211_-_SP_2024_-_Block_5_-_FE_1927.webp
P

PRN211_-_SP_2024_-_Block_5_-_FE_1927.webp

Inle Choices
(Choose 1 answer)
class MyClass
{
public int a { get; set; }
public int b { get; set; }
public MyClass(int x, int y) =>(a,b)=(x, y);
public void Print(){
var r = Sum():
Console.WriteLine($"{r}"):
static int Sum(){var s = 0;
for (int i = a; i <= b; i++) { s += i;
}
return s;
}
class Program {
static void Main(string[] args){
MyClass obj = new MyClass(1, 3);
obj.Print():
}
} The output will be:
A. Compile-time error
B. 0
C. 6
D. 4

67

Thông tin

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

Image metadata

Filename
PRN211_-_SP_2024_-_Block_5_-_FE_1927.webp
File size
181.5 KB
Dimensions
1920px x 930px

Share this media

Back
Bên trên Bottom