Why output is 28 pls explain guys | Sololearn: Learn to code for FREE!

0

Why output is 28 pls explain guys

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

c

10/17/2021 5:06:33 AM

Lathesh poojary

5 Answers

New Answer

+3

Macro substitution is simple text replacement before it compiles. (28/square(4)) Replace square(4) with 4*4: (28/4*4) Now reduce according to order of operations (left to right in this case): (7*4) (28) Proper macro definition would fix it: #define square(x) ((x)*(x))

+1

Brian, that is correct. Thanks for the explanation

+1

thanks for explanation🙏🙏

0

I'm no expert in C but it gives the expected result (1) when you enclose square(4) in parentheses; (square(4))

0

David Akhihiero your right but how it evaluate in this case bro without parentheses