Question: What is wrong, logically , with the following code? if ) > ( 1 0 System.out.println ( Large ) ; else if )

What is wrong, logically, with the following code?
if )>(10 System.out.println("Large");
else if )>6&&x(10 System.out.println("Medium");
else if )>3&&x(6 System.out.println("Small");
else System.out.println("Very small");
There is no logical error, but there is no need to have )(10 in the second conditional or
in the third conditional
There is no logical error, but there is no need to have )>(6 in the second conditional or )>(3 in the third conditional
The logical error is that no matter what value x is, "Very small" is always printed out
The logical error is that no matter what value x is, "Large" is always printed out
 What is wrong, logically, with the following code? if )>(10 System.out.println("Large");

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!