+ 2

Explaination about what prod(i,j) i*j is doing and how the value of prod(x+2,y-1) we get? (ans for this code is 10)

#define prod(i,j) i*j int main() { int x=3, y=4; printf("%d \n",prod(x+2,y-1)); return 0; }

4th Jan 2019, 3:29 PM
Vijaya Mishra
Vijaya Mishra - avatar
4 Respuestas
+ 6
It's not doing (x+2)(y-1) as expected but rather x+2*y-1 = 3+2*4-1 = 10
4th Jan 2019, 3:38 PM
Diego
Diego - avatar
+ 2
You're welcome. Happy coding!
4th Jan 2019, 3:44 PM
Diego
Diego - avatar
+ 1
Diego Acero thankyou for the Explaination :-)
4th Jan 2019, 3:40 PM
Vijaya Mishra
Vijaya Mishra - avatar
+ 1
Thanks! 😃Diego Acero
4th Jan 2019, 4:09 PM
Vijaya Mishra
Vijaya Mishra - avatar