CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

Basic If-Else Chain

Java code walkthrough · Question 13
easyIf Statements

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 int score = 72;
4 if (score >= 90) {
5 System.out.println("A");
6 } else if (score >= 80) {
7 System.out.println("B");
8 } else if (score >= 70) {
9 System.out.println("C");
10 } else {
11 System.out.println("F");
12 }
13 }
14}

Your answer