Originally Posted by
drinu1232
Hi all,
I am new in programming with C. Will you please help me to solve the following problem:
I want a program whose function is to enter the volume of a sphere 'x' and the program has to find out the unknown radius of the sphere and when the program finds radius, the program has to tell you if the sphere can go through the pipe of not.
From your posted source code...
You need to look up the caret ( ^ ) operator I don't think it does what you think it does.
Move the calculation of b above your first printf() and have printf print b instead of doing the math twice. It will also give you confirmation that b is calculated correctly.
There's no need for multiple ifelse structure. The sphere either fits or it doesn't...
Code:
if (b < 5)
printf("it fits");
else
printf(it don't fit");
Also please use code tags when posting your code to the forum.