General Doubt Regarding Code

Here is the code - https://ide.codingblocks.com/s/416666
to return area of rectange using the inline function, but don’t know why is it not printing the decimal value and also the output is not correct. Please explain what is wrong there in code.

See this


What’s happening in this is, you are sending double arguments and converting it as an int argument in the function. So what is happening is it’s taking 5.1 as 5 and 3.4 as 3. Multiplies 3x5 gives 15. Now since your return type is of double. It’s converting 15 to 15.0000 that’s the reason you weren’t getting decimal values
This is what is happening

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.