0

Can some one explain this?

#include <stdio.h> #define sqr(i) i*i int main() { printf ("%d %d",sqr(3),sqr(3+1)); return 0; }

30th Mar 2020, 6:14 AM
Ravishan Fernando
Ravishan Fernando - avatar
5 Answers
+ 1
sqr (3) = 3*3 = 9 sqr (3+1) = 3+1*3+1 = 7
30th Mar 2020, 6:17 AM
Avinesh
Avinesh - avatar
+ 3
sqr sqr (3) = 3*3 = 9 Its calculate like this sqr (3+1) = 3+1*3+1 is equal to 7
30th Mar 2020, 7:51 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
30th Mar 2020, 6:16 AM
šŸ‡®šŸ‡³OmkaršŸ•‰
šŸ‡®šŸ‡³OmkaršŸ•‰ - avatar
0
its not a function, its a macro.
30th Mar 2020, 6:33 AM
Choe
Choe - avatar
0
i am a master c++ so do not try to callange mešŸ˜‰
30th Mar 2020, 11:23 AM
Monzer