C++ is ignoring half of a math function.

So I'm trying to display the Volume of a Porcelain wash with C++ using Length, Width, Height, and Radius imputed from the user. I'm using Pi as a Variable as I'm instructed to not use stuff that hasn't been done in class.

#include <iostream>
#include <math.h>
using namespace std;


int main ()

{
const double pi=3.14159;
double Vol, Len, Wid, Hei, Rad;

cout<<"Hi, this will find out the volume of a Porcelain Wash basin for you."
<<endl <<endl <<endl <<endl;

cout<<" Please enter the length of the box-shaped base in inches"<<endl;
cin>> Len;

cout<<"Thank you. Please enter the width of the base in inches"<<endl;
cin>> Wid;

cout<<"Thank you. Please enter the height of the base in inches"<<endl;
cin>> Hei;

cout<<"Thank you. Finally, enter the radius of the basin cut out of the base."<<endl;
cin>> Rad;

cout<<"Thank you. One moment." <<endl <<endl <<endl <<endl <<endl;
Vol = (Len * Wid * Hei) - (2/3 * (pi * pow(Rad, 3)));

cout<<"The Volume of the Basin box minus the hemisphere is = " <<Vol <<endl;

return 0;
}


When I run this with debugging, I test it out with basic numbers. No mater what numbers I use it only gives me the calculation of the first part and ignores the second part. Does anyone have any ideas?
[ code ] [ /code ] tags.

What is "the first part" here?
The first part of the equation.
(Len * Wid * Hei)-(2/3 * (pi * pow(Rad, 3)))

But I think I figured it out. I have 2/3 which turns into 0, negating the whole second half.
That is correct.

You're attempting to do 0 * something.

It's a good program though.
Topic archived. No new replies allowed.