top of page

AP CSA question for September 9th, 2024

Sep 9

1 min read

0

3

0

What will the following code segment output?


public class Main {

public static void main(String[] args) {

int[] arr = {5, 10, 15, 20, 25};

int sum = 0;

for(int i = 0; i < arr.length; i += 2)

sum += arr[i];


System.out.println(sum);

}

}


A. 25


B. 30


C. 40


D. 45



What is your answer, don't forget to check out the video explanation at the bottom!

  • A

  • B

  • C

  • D


video explanation

Sep 9

1 min read

0

3

0

Comments

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