└── volume /volume: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace std; 4 | 5 | int main() { 6 | double radius, volume; 7 | 8 | // Input the radius of the sphere 9 | cout << "Enter the radius of the sphere: "; 10 | cin >> radius; 11 | 12 | // Calculate the volume of the sphere 13 | volume = (4.0 / 3.0) * M_PI * pow(radius, 3); 14 | 15 | // Output the result 16 | cout << "The volume of the sphere is: " << volume << endl; 17 | 18 | return 0; 19 | } 20 | --------------------------------------------------------------------------------