1 votes 1 votes Please tell the output and explain in detail. #include<stdio.h> #define A -B #define B -C #define C 5 int main() { printf("The value of A is %d\n", A); return 0; } Shubham Kumar Gupta asked Sep 20, 2017 Shubham Kumar Gupta 223 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes answer is 5 In the printf A will be replaced by -B and B will be replaced by -C. Thus it becomes simply C. again C will be further replaced by 5. Happens due to macro replacements. Tuhin Dutta answered Sep 20, 2017 Tuhin Dutta comment Share Follow See all 2 Comments See all 2 2 Comments reply Shubham Kumar Gupta commented Sep 20, 2017 reply Follow Share Why it isn't replaced with --5 ? 0 votes 0 votes Tuhin Dutta commented Sep 20, 2017 reply Follow Share So it was -B then replaced by -C, i.e -(-C) or C. Then it replaced by 5. 0 votes 0 votes Please log in or register to add a comment.