Computer Science, asked by mayanksaha119413, 9 months ago

The expression x = -7%2-8 would evaluate to.........

Answers

Answered by Equestriadash
4

x = -7%2 - 8

Let's first understand the order of precedence of operators.

By symbols:

**, *, /, //, %, +, -

By operation name:

Exponentiation, Multiplication, Division Integer Division, Modulus, Addition, Subtraction.

Applying the precedence to the expression,

-7%2 - 8

Modulus takes place first. In Modulus, only the remainder is taken.

1 - 8

What's left is subtraction.

-7

Therefore, -7%2 - 8 = -7.

x = -7


Equestriadash: Thanks for the Brainliest! ♥
Answered by divyakumari13823
3

Answer: -9

Explanation:

Similar questions