Program to calculate volume of sphere in C++
In this Program we will use Formula V=(4πr3 )/3 to calculate Volume of Sphere in C++.
Here is the Source code of Program to calculate volume of sphere in C++
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include<iostream> using namespace std; int main() { int rad,vol; cout<<"Enter Radius of Sphere : "; cin>>rad; vol=(4*3.14*rad*rad*rad)/3; cout<<"Volume of Sphere = "<<vol; return 0; } |
Output: