In a nutshell,this is the code of the area,lateral area and volume of a cone from a class structure -:
Code:
else if(g[0] == 'N' || g[0] == 'n')
{
cout << "Enter radius of the cone - ";
cin >> a;
cout << "\nEnter slant height of the cone - ";
cin >> b;
cout << "\nEnter perpendicular height of the cone - ";
cin >> x;
float Area = (M_PI * a) * (a + b);
float L_area = M_PI * a * b;
float Volume = 1/3 * M_PI * pow(a,2) * x;
cout << "\nThe CSA is " << L_area << endl;
cout << "The TSA is " << Area << endl;
cout << "The volume is " << Volume << endl;
}
But the volume keeps coming 0 for whatever value I put..I don't seem to find anything wrong..help please