PRF192_-_SU_2024_-_FE_2315.webp
hoangha297

PRF192_-_SU_2024_-_FE_2315.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.

Thông tin

Category
PRF192
Thêm bởi
hoangha297
Ngày thêm
Lượt xem
3,065
Lượt bình luận
10
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom