Answer to Question #263001 in C++ for Rille

Question #263001

The Area of a Circle = pi *(r*r). Where pi=3.1415 and r=Radius, Make a program that will


input Radius and compute and display the Area. Your program will be terminated if input zero


in the radius.

1
Expert's answer
2021-11-11T07:31:07-0500
#include<iostream>
using namespace std;
int main(){
	 double pi=3.1415, r;
	 do{
	 	cout<<"Enter radius:\n";
	 	cin>>r;
	    double area = pi *(r*r);
	    cout<<"The radius is: "<<r<<"\nThe area is: "<<area<<endl;
	 } while(r !=0);
	 cout<"The program terminated successfully";
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS