PRF192_-_SU_2024_-_Block_5_-_RE_2704.webp
Quốc Hùng2

PRF192_-_SU_2024_-_Block_5_-_RE_2704.webp

Kizspy | Question: 35 (Choose 1 answer)
Consider the following code:
int func(int* a, int n){int S = 0;for(int i = 0; i < n; i++) { } S = S + (a[i] % 2)*a[i];return S;
}
What does the above code snippet do?
A. Calculates the sum of the absolute value of all odd elements in the array a of size n.
B. Calculates the sum of all odd elements in the array a of size n.
C. Calculates the sum of all even elements in the array a of size n.
D. Calculates the sum of squares of all elements in the array a of size n.
FUOVER

Thông tin

Category
PRF192
Thêm bởi
Quốc Hùng2
Ngày thêm
Lượt xem
2,542
Lượt bình luận
6
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom