+ 1

Explain me this code please

#define sqr(X)X*X Int X=16/sqr(4); printf ("%d",X); Why it's answer is 16??

23rd Jun 2020, 8:52 AM
Manish Kumar Choumiyan
Manish Kumar Choumiyan - avatar
2 Answers
+ 3
#define replaces every instance of sqr(X) with X*X. So following this :- 16/sqr(4) Is replaced by 16/4*4 And by *BODMAS* it solves to 16 Hence the output is 16
23rd Jun 2020, 8:57 AM
Arsenic
Arsenic - avatar
+ 1
Got it bro thanks ☺️
23rd Jun 2020, 8:59 AM
Manish Kumar Choumiyan
Manish Kumar Choumiyan - avatar