Where am i going wrong?

Can somebody please tell where am i going wrong?

Also i am getting an error of .000000003 with this test case 2
100 5 10
100 1 50 . Why?
LINK Solution 1 -CodeChef: Practical coding for everyone
.Solution-2 CodeChef: Practical coding for everyone

You forgot to print each answer in a new line. Hope it helps :slight_smile:

1 Like

Use double instead of float and check.

i tried. Infact i changed the entire code from for loop to while loop but nothing helped. modified code link - CodeChef: Practical coding for everyone

yes that was it. thank you so much.Also it wasn’t an error of 0.000003 but 3 was the next input. Stupid me :}. Thanks again.

cool, you can mark the answer as “accepted”