Error in data type

please correct the error only and specify the reason

https://ide.codingblocks.com/s/182804 . here is code

@mohdkaifalam041,
https://ide.codingblocks.com/s/182810 Correct code. Change all int to double and while printing the answer put int(k).