What is the output of this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

9th Jan 2018, 9:16 AM
Randeep Singh
Randeep Singh - avatar
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
9th Jan 2018, 9:21 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 10
okk thank you so much
9th Jan 2018, 9:23 AM
Randeep Singh
Randeep Singh - avatar
+ 8
okk thanks somasundaram and siraj
10th Jan 2018, 2:20 AM
Randeep Singh
Randeep Singh - avatar
+ 6
You are welcomed :)
9th Jan 2018, 9:37 AM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 3
well just remeber the operator preference multiplication operator has more preference then addtion
9th Jan 2018, 7:22 PM
Siraj Ali
Siraj Ali - avatar
+ 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
10th Jan 2018, 1:41 AM
Somasundaram R
Somasundaram R - avatar
+ 2
ur welcome dude
10th Jan 2018, 4:06 AM
Siraj Ali
Siraj Ali - avatar