Ask Question

What value will be assigned to the answer variable as a result of the statement: answer = 3 + 2 * 4 % (2 + 4) A. 2B. 4C. 5D. 10

+2
Answers (1)
  1. 3 March, 00:06
    0
    5

    Explanation:

    The order of execution is very important in solving the question

    () - first

    * and % operator takes the same amount of precedence then you consider the order from left to right

    then + last

    3 + 2 * 4 % (2 + 4) = 3 + 2 * 4 % 6 = 3 + 8 % 6 = 3 + 2 = 5

    So 5 is the value that will be assigned to the answer variable

    Note:

    8 % 6 is the remainder of 8/6 which is 2.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What value will be assigned to the answer variable as a result of the statement: answer = 3 + 2 * 4 % (2 + 4) A. 2B. 4C. 5D. 10 ...” 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