Ask Question
5 July, 09:11

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

+5
Answers (1)
  1. 5 July, 09:19
    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 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