+ 19
What is the output of this code?
plz explain the output of this code. thanks in advance. https://code.sololearn.com/c2UBnA8T74f0/?ref=app
7 Answers
+ 11
When you define a macro, its content is simply copied so your code looks like that :
i = x*x*x; // let's replace it with x value
i = 5 + 2 * 5 + 2 * 5 + 2; // which is 27
You can do the same with j and y
+ 10
okk thank you so much
+ 8
okk thanks somasundaram and siraj
+ 6
You are welcomed :)
+ 3
well just remeber the operator preference
multiplication operator has more preference then addtion
+ 2
use parenthesise in macro definition to achieve correct mathematical order of execution (BODMAS).
check your updated code-
https://code.sololearn.com/cFUurr3X0VOe/?ref=app
+ 2
ur welcome dude