| preferred AP College board partner for AP classes
AP Computer Science A/Unit 6: Array
Start Practice Test
Share
medium Solved by 5 students
Integer Division in Array Calculation
< Prev
Next >

What is printed to the console when the following code is executed?

public class Main {
    public static void main(String[] args) {
         int[] scores = {88, 92, 76, 81};
         int total = 0;
         for (int i = 0; i < scores.length; i++) {
              total += scores[i];
         }
         double average = total / scores.length;
         System.out.println(average);
    }
}
A

84.0

B

337

C

84.25

D

84

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1suhanakochhar00601 0m 00s 0
#2singhris00012 1m 32s -2
#3geethasailaja01 0m 15s -25
#4y.seong202712 2m 42s -72
#5suhanakochhar00602 8m 47s -547
#6bommasam00026 1h 33m -5,466
APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy