top of page

AP CSA problem

Sep 27

1 min read

0

1

0

int[] nums = {1, 3, 4, 5, 6, 7};

int count = 0;

for(int num : nums)

{

count--;

if (num % 2 == 0)

count++

}

return count;



what will this code segment return?


(A) 4

(B) -4

(C) 2

(D) 6



What is your answer, don't forget to check out the video explanation.

  • A

  • B

  • C

  • D

video explanation

Sep 27

1 min read

0

1

0

Comments

Share Your ThoughtsBe the first to write a comment.
bottom of page