How it is calculate? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How it is calculate?

How it is calculate by compiler #define x 9+2/4*3-2*4+(5-4)*3 x*x*x = ?

29th Feb 2020, 7:54 PM
Rahim Ullah
Rahim Ullah - avatar
1 Answer
+ 3
In your program, when ever x is present, the compiler just replaces the x with a predefined constant in stack.. Rest evaluation is same as any other expressions. In this ex: x*x*x is replaced by 9+2/4*3-2*4+(5-4)*3 * 9+2/4*3-2*4+(5-4)*3 * 9+2/4*3-2*4+(5-4)*3 =42 [if am calculated correctly..]
29th Feb 2020, 8:10 PM
Jayakrishna 🇮🇳