Ask Question
12 March, 19:18

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. 12 March, 20:13
    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?
Get 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 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