Westonci.ca offers fast, accurate answers to your questions. Join our community and get the insights you need now. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

Write an expression that evaluates to true if the value of the int variable widthOfBox is not divisible by the value of the int variable widthOfBook. Assume that widthOfBook is not zero. ("Not divisible" means has a remainder.)

Sagot :

Answer:

The expression is:

if widthOfBox % widthOfBook != 0

Explanation:

Given

Variables:

(1) widthOfBox and

(2) widthOfBook

Required

Statement that checks if (1) is divisible by (2)

To do this, we make use of the modulo operator. This checks if (1) is divisible by 2

If the result of the operation is 0, then (1) can be divided by (2)

Else, (1) can not be divided by (2)

From the question, we need the statement to be true if the numbers are not divisible.

So, we make use of the not equal to operator alongside the modulo operator