| preferred AP College board partner for AP classes
easy Solved by 4 students
Java If-Else If-Else Logic
< Prev
Next >

What output will the code produce?

public class Main {
    public static void main(String[] args) {
        int x = 4;
        if(x > 5) {
            System.out.println("Greater than 5");
        } else if(x == 5) {
            System.out.println("Equal to 5");
        } else {
            System.out.println("Less than 5");
        }
    }
}
A

No output

B

Greater than 5

C

Equal to 5

D

Less than 5

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
#1mahmoudjibrin0811 0m 00s 100
#2lsj0803092211 0m 00s 100
#3psak1211 0m 11s 89
Items per page:
10
1 – 3 of 3
No comments yet. Be the first to comment!

AI Tutor

How can I help?

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