Ask Question
16 September, 02:20

Consider the following code segment, which uses the int value a. if ((a > 12) || (a < 4)) System. out. println ("New value: " + a/3); else System. out. println ("New value: " + 2*a); For which, if any, of the following initial values of a will the statement "New value: 4" be printed when the code is executed?

+1
Answers (1)
  1. 16 September, 05:39
    0
    a = 13 and 14

    Step-by-step explanation:

    The "/" does ordinary division when applied. So when a = 13 and a = 14, both greater than 12, it found the values 4,33 and 4,66, respectively, and java itself round it to 4.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Consider the following code segment, which uses the int value a. if ((a > 12) || (a < 4)) System. out. println ("New value: " + a/3); else ...” in 📙 Mathematics if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers