# include <stdio.h>
# define MUL (a, b) a ∗ b
# define pow (a) a ∗ a
int main ( )
{
int a = 3;
int b = 2;
printf (“%”, MUL (MUL (a+1, b), pow (b + 1)));
return 0;
}
Here we are using the #define directory, it goes through the entier program, search the macro template. whenever it finds, it replaces the macro template with appropriate macro expansion.
so expression in printf will be:
MUL ( MUL(a+1,b) , pow (b+1) )
MUL(a+1,b) *pow(b+1)
((a+1)*b)*(b+1)*(b+1)
3+1*2*2+1*2+1
3+2*2+2+1
3+4+2+1 = 10
* has higher priority than + and associativity is left to right.