I have got a task to create a program that calculates the diameter of the sphere of volume 1234.67 cu meters.
I have Written the following code : -
#include <iostream>
#include <math.h>
using namespace std;
int main(){
float vol, dm, h;
vol = 1234.67;
cout << "Calculating the diameter of sphere with volume 1234.67 cu meters" << endl;
h = vol*(3/4)*(7/22);
dm = 2 * cbrt(h);
cout << "The diameter of sphere with volume 1234.67 cu meters is " << dm << endl;
return 0;
}
What's wrong with my program , it gives 0 as the output
Calculating the diameter of sphere with volume 1234.67 cu meters
The diameter of sphere with volume 1234.67 cu meters is 0