Ask Question
6 May, 21:31

If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value of myInt is 0? int other = 3, myInt; if (myInt! = 0 && other % myInt! = 0) printf ("other is odd/n"); else printf ("other is even/n");

+3
Answers (1)
  1. 6 May, 21:47
    0
    other is even.

    Step-by-step explanation:

    Since the value of myInt variable is assumed to be 0 and we have other = 3. In the if condition the expression is true only when the myInt is not equal to zero and and the remainder of other/myInt is not equal to zero (%modulus operator provides the remainder). myInt is 0 hence the expression returns false and the else block is executed so it prints other is even.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value of myInt is ...” in 📗 Mathematics 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