+ 1

Ple. Explain

#define sqr(i) i*i int main(){ printf ("%d%d", sqr (3), sqr (3+1)); }

24th Jul 2019, 11:50 AM
Mohd Vais
Mohd Vais - avatar
4 Respuestas
+ 8
Mohd Vais #define macro is used to substitute the value written after macro so sqr(i) will replace by i×i So when i value is (3+1) then due to macro substitution it will evaluate like 3+1×3+1 so 3+3+1=7 will return so output is 97
24th Jul 2019, 11:55 AM
GAWEN STEASY
GAWEN STEASY - avatar
+ 1
Macro definition will replace the source code directly. So the second output will be 7, because 3 + 1 * 3 + 1
24th Jul 2019, 11:54 AM
Agent_I
Agent_I - avatar
+ 1
What is output ?
24th Jul 2019, 11:55 AM
Mohd Vais
Mohd Vais - avatar
- 1
explain what?
24th Jul 2019, 11:53 AM
Julian Dörling
Julian Dörling - avatar