don't getting correct volume of a sphere from my C code? -
i have started learning c programming.i have question.
i wanna calculate volume of sphere radius.my code is:

but not giving me correct ans 1523.result 14797486080.000 correct ans 14797486501.627.where problem?
i found problem here https://www.urionlinejudge.com.br/judge/en/problems/view/1011
your computation performed in double , converted on assignment float, loose precision. should declare q double.
also if concerned precision, should use better approximation of π.
Comments
Post a Comment