WRONG OUTPUT IN VOLUME OF SPHERE

ques- https://hack.codingblocks.com/app/contests/1915/1775/problem
code-
https://ide.codingblocks.com/s/377662

hello @aaliyah_beg
pls check ur updated code here->

Sir even this will work----> https://ide.codingblocks.com/s/377689

@aaliyah_beg
yeah it is working.
but always put .0 whenever u r working with double or float to avoid any integer divison.

try this and see the difference->

Yes sir this in accordance to precedence and associativity would give zero as 4/3 is zero[int /int =int].

Sir , but why does double works but float doesn’t

float has less precision than double thats why

4/3 will give 1 .
thats why i was telling u to use 4.0 / 3.0 to avoid such mistakes

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.