Answer to Question #157226 in C++ for Riola Sadtoi

Question #157226

Part 1 Question Link: https://ibb.co/swzRK4w

Part 2 Question Link: https://ibb.co/P9WnMC0


1
Expert's answer
2021-01-22T05:15:32-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog