Here is a C++ program to calculate the volume of a sphere:
#include <iostream>
#define PI 3.14159
using namespace std;
int main() {
float radius, volume;
cout << "Enter the radius of the sphere: ";
cin >> radius;
volume = (4/3.0) * PI * radius * radius * radius;
cout << "Volume of the sphere is: " << volume << endl;
return 0;
}
This program first includes the iostream library for input/output functions. It then defines PI as a constant. In main(), it prompts the user to enter the radius, reads it using cin and stores it in