I checked the search and did not find a specific answer to my problem. Hope you guys can help me on this one. I need to find the volume of a radius and I am having problems getting the return to enter the correct numbers back in main so I can send it out to another 2 functions. This is what I have so far. I know very noobish.
#include <iostream>
#include<cmath>
using namespace std;
cout<<"What radius do you want to process?"<<endl;
cin>>radius;
return radius;
}
long CalcNumber (long a,long b, long c)
{
long v,r,pi;
pi=3.14;
v=((4/3)*pi*(3,r));
return(v);
}
void DisplayNumber (long a)
{
long volume;
cout<<"The volume is"<<volume<<endl;
}
If any of you guys can get this simple program to work right I can work off that. Once again I looked at the beginners function guide and had no luck. Fell free to change anything as long as this works right and to only use iostream and cmath, Thanks.
There are so many errors with my program. Let me try to make this clearer I need to get a radius with function one, Then compute its volume with function two, finally give the output with function three. 4/4*pi*(3,r) is the volume formula. R = radius in this case.
Thanks so much for getting it to run but it still isnt calculating volume. The answer always comes out the same 9. The formula for volume is 4/3 * pi radius to the third power. The one I have on the program is wrongly structured. Thanks for your help anyway.