PRN221_-_SU_2024_-_FE_2416.webp
H

PRN221_-_SU_2024_-_FE_2416.webp

Kizspy | Question: 48 (Choose 1 answer)
class Program{
public static async Task<int> Method1(){
int sum = 0;await Task.Run(() => {
for (int i = 1; i <= 5; i++){
sum += i;
}
});
return sum;
}
public static void Method2(int sum) {
Console.WriteLine($"{++sum}");}
public static async Task callMethod(){var s = await Method1();
Method2(s);}
static async Task Main(string[] args) {
await callMethod();
Console.ReadKey();
}
} Which one of the following is the output of the above code?
A. 16
B. 15
C. 14
D. 17
FUOVER

Thông tin

Category
PRN221
Thêm bởi
Hạnh Phúc
Ngày thêm
Lượt xem
1,093
Lượt bình luận
3
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom