1 votes 1 votes I'm not able to understand how literal substitution will work while running this code? #define CALC(X) (X*X) int main() { int a, b=5; a = CALC(b+2); printf("\n a= %d b=%d", a,b); } AIkiran01 asked Jun 6, 2017 AIkiran01 242 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes Output is a=17 and b=5; first of all i will explain you that "The macro arguments are not evaluated before macro expansion. " so when we pass the argument to this macro it will look like b=5; so a=CALC(5+2)// the macro calculate5+2*5+2 so a=17; and the value of b will unchanged. Nitesh Choudhary answered Jun 6, 2017 Nitesh Choudhary comment Share Follow See all 0 reply Please log in or register to add a comment.