Ask Question

Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed second?

+2
Answers (1)
  1. 16 August, 01:46
    0
    In the first expression

    3 * 4 will be performed second.

    In the second expression

    10 * 2 will be performed second.

    Explanation:

    In many programming language, there is an operator precedence where the operator (e. g. +, -, *, / etc) will be executed following a specific order. For example, the operator ^ which denotes power will always be executed prior to * or / and if / and * exist in the same expression, the operator positioned at the left will be executed first.

    Hence, in the expression 3*2^2 < 16, 2 will be powered to 2 (2^2) first and then only multiplied with 3.

    In the expression 100 / 10 * 2 > 15 - 3, 100 will be divided by 10 and then only multiplied with 2.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Consider the expression 3 * 2 ^ 2 15 - 3. Which operation is performed second? ...” 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