Ask Question
24 July, 18:55

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. 24 July, 19:56
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers