Part 1 Question Link: https://ibb.co/swzRK4w
Part 2 Question Link: https://ibb.co/P9WnMC0
#include <iostream>
#include <cmath>
using namespace std;
void ComputeVolume (int height, int radius) {
const float pi = 3.14;
cout << "The volume of cone is " << ( 1.0 / 3 ) * pi * pow(radius, 2) * height << endl;
}
int main () {
int h, r;
cout << "Enter the height of cone: "; cin >> h;
cout << "Enter the radius of cone: "; cin >> r;
ComputeVolume(h, r);
return 0;
}
Comments
Leave a comment