So, I'm confused why the output of i would be 27 and not 343
#include <stdio.h>
#define x 5+2
void main() {
int i;
i=x*x*x;
printf("%d",i); }
So, I'm confused why the output of i would be 27 and not 343
#include <stdio.h>
#define x 5+2
void main() {
int i;
i=x*x*x;
printf("%d",i); }
Let's expand what you did, preprocessor is a dummy thing that just replaces the token with text
i = 5+2*5+2*5+2; // <- 27
if you modify define
to be #define x (5+2)
all should work as expected.