PRF192_-_FA_2024_-_FE_2937.webp
M

PRF192_-_FA_2024_-_FE_2937.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
morning_sun
Ngày thêm
Lượt xem
3,184
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom