int score = 95;
if (score >= 70) {
System.out.println("C");
}
if (score >= 80) {
System.out.println("B");
}
if (score >= 90) {
System.out.println("A");
}What is printed (each on its own line)?
- Acheck_circle
C, B, A on three lines
- B
A only
- C
C only
- D
A, B, C on three lines
Explanation
These are three separate if statements (not else if). All three conditions are true for score 95, so "C", "B", and "A" all print in that order.