Guess the output and explain why? | Sololearn: Learn to code for FREE!

+1

Guess the output and explain why?

https://code.sololearn.com/ccdWBc62ikiE/?ref=app

c

9/11/2019 5:42:05 AM

Sudhanshu

2 Answers

New Answer

+3

It is because operators precedence. If you try to calculate 3 - 2 * 4, the multiplication is evaluated first and then the subtraction, thus -2 * 4 = -8 and 3 - 8 = -5. If you want to change the order of operations you must use parentheses: (3 - 2) * 4 = 1 * 4 = 4.

+2

Write the macro as (i)*(j)