A
Q. What is the output of the following code?
Code:
int x = 10;
if (x < 5) {
System.out.println(“x is less than 5”);
} else if (x > 20) {
System.out.println(“x is greater than 20”);
} else {
System.out.println(“x is between 5 and 20”);
}
if (x < 5) {
System.out.println(“x is less than 5”);
} else if (x > 20) {
System.out.println(“x is greater than 20”);
} else {
System.out.println(“x is between 5 and 20”);
}
- Correct Answer - Option(C)
- Views: 15
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.