175k views
1 vote
The if statement from problem 4 could also be written as: I. if (exponent < 8) System.out.println("exponent is 8 or less"); II. if (exponent > 8) System.out.println("exponent is 8 or less"); III. if (exponent <= 8) System.out.println("exponent is 8 or less");

User DJ Spiess
by
6.3k points

1 Answer

7 votes

Answer:

III. if (exponent <= 8) System.out.println("exponent is 8 or less");

Explanation:

For the exponent to be 8 or less than 8 we have to use (<=) less than or equal to,this operator returns true only when the LHS value is less or equal to the RHS value.

Here if statement will be true if the value of exponent is less than or equal to 8 and the message will be printed that exponent is 8 or less.

User Smessing
by
5.6k points