If Else If Control Flow
What is printed when the following code segment is executed?
public class Test {
public static void main(String[] args) {
int value = 10;
if(value > 10)
System.out.println("Greater than 10");
else if(value == 10)
System.out.println("Equal to 10");
else
System.out.println("Less than 10");
}
}
A
No output
B
Less than 10
C
Greater than 10
D
Equal to 10
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | b.bao.o | 2 | 2 | 0m 00s | 200 |
| #2 | winstonhou1107 | 1 | 1 | 0m 00s | 100 |
| #3 | liuwilliam072410 | 1 | 1 | 0m 34s | 66 |
| #4 | demosolasis1 | 1 | 1 | 0m 55s | 45 |
| #5 | asda | 0 | 1 | 0m 01s | -11 |
Items per page:
10
1 – 5 of 5
APFIVE