| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice TestPractice Test
About Exam
easy Solved by 6 students
Conditional Array Modification
< Prev
Next >

What is the output of the program?

public class ConditionalArray {
    public static void main(String[] args) {
        int[] nums = {5, 3, 8, 2, 7};
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] % 2 == 0) {
                nums[i] += 10;
            }
        }
        System.out.println(nums[3]);
    }
}
A

5

B

12

C

2

D

7

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1deltasmpserver22 0m 00s 200
#2tellabhinaya11 1m 43s -3
#3sailajavadlamani3312 4m 37s -187
#4bommasam00014 21m 59s -1,249
Items per page:
10
1 – 4 of 4
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy