C++ Program to Compute the Volume of Sphere and Print in Command Line

C++ Program to Compute the Volume of Sphere and Print in Command Line Article has many meanings. We are going to know this topic clearly through this article. We hope you like this article.

C++ Program to Compute the Volume of Sphere and Print in Command Line

#include <iostream>
using namespace std;

    int main()
    {
    	int rad1;
    	float volsp;
		cout << "nn Calculate the volume of a sphere :n";
		cout << "---------------------------------------n";		
        cout<<" Input the radius of a sphere : ";
    	cin>>rad1;
    	volsp=(4*3.14*rad1*rad1*rad1)/3;
        cout<<" The volume of a sphere is : "<< volsp << endl;
        cout << endl;
        return 0;
    }

Read Also: C++ Program to Display the Cube of Number Upto Given an Integer in Command Line

Final Words

C++ Program to Compute the Volume of Sphere and Print in Command Line We got to know our topic very clearly. And if you have any doubts about this article you can let us know your doubts via comment.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment