PRF192_-_SP_2025_-_RE_3698.webp
plum_blossom1

PRF192_-_SP_2025_-_RE_3698.webp

Kizspy | Question: 37
(Choose 1 answer)
pjoven low lan
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
plum_blossom1
Ngày thêm
Lượt xem
1,103
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom