Write a program in C++, which takes the radius from the user and calculates the area of the sphere i.e Area=4pr2
(Hint p = 3.1416
Area = 4 * 3.1416 * r * r)
Write a program in C++, which takes the radius from the user and calculates the area of the sphere i.e Area=4pr2 |
SOLUTION :
#include<iostream>
using namespace std;
int main ()
{
int radius,area;
cout<<"Enter the Radius :";
cin>>radius;
area=4 * 3.1416 * radius * radius;
cout<<"Area :"<<area<<endl;
return 0;
}
random/hot-posts
PROGRAMMING QUESTIONS/feat-big