/*--------------------------------------------------------------------*/ /* This program computes the volume V of a cylinder of radius r and height h. */ #include using namespace std; const double PI = 3.141593; int main() { /* Declare variables. */ double r, h, volume; /* Enter the radius of the cylinder. */ cout << "Enter the radius r of the cylinder: "; cin >> r; /* Enter the height of the cylinder. */ cout << "Enter the height h of the cylinder: "; cin >> h; /* Compute the volume of the cylinder. */ volume = PI * r * r * h; /* Print the value of the volume. */ cout << "The volume of a cylinder with radius " << r << " and height " << h << " is: " << volume << endl; /* Exit program. */ return 0; } /*--------------------------------------------------------------------*/