Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- cout << "Program to calculate the volume of a sphere\n";
- cout << "-------------------------------------------\n";
- cout << "Enter the radius of the sphere: ";
- float r;
- cin >> r;
- float volume = 4.0 / 3.0 * M_PI * pow(r, 3);
- cout << "The volume of the sphere is: " << volume;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment