0

C++ define

*C++* #include <iostream> using namespace std; #define x 5+2 int main() { int i; i=x*x*x; cout<<i; return 0; } I dont understand why the output is 27

11th Jun 2020, 8:29 PM
Larthux
Larthux - avatar
2 Answers
+ 2
5+2*5+2*5+2 = 5 + 10 + 10 + 2 = 27
11th Jun 2020, 8:33 PM
Mustafa K.
Mustafa K. - avatar
+ 1
Thanks, it's easier than what I tought😂
11th Jun 2020, 8:36 PM
Larthux
Larthux - avatar