Ask Question

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

+2
Answers (1)
  1. 1 June, 19:32
    0
    int widthOfBox; / /declaration

    int widthOfBook; / / declaration

    if (widthOfBox%widthOfBook!=0) {

    }

    Explanation:

    This expression will evaluate to true if the value of widthOfBox is not divisible by widthOfBook.

    The modulo operator (%) is used for this evaluation since widthOfBox %widthOfBook will evaluate to zero if the widthOfBox is divisible by widthOfBook
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write an expression that evaluates to true if the value of the integer variable widthOfBox is not divisible by the value of the integer ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers