Why am I getting WA for my submission for AVG?

I am unable to figure out why my solution for the problem is giving WA.
What corner case am I missing here?

Hey @noobkomder , you need to typecase x as int before printing it. Or better make another variable with datatype int and assign the value you need to print. The reason is while printing float there are possibilities of precision error to happen.
For example, for x = 104, with datatype float, it may be outputted as something like 104.00000124

1 Like

You cleared my doubts! Thank you so much :smiley:

1 Like