Answer to Question #218723 in C++ for abc deefgh

Question #218723

professor chang wants a program that caculates and displays the are of a circle, given the circle's radius. the formula for calculating the area of a circle is πr^2, where π and r represents pi and the radius, respectively. the professor wants to use the value of pi reounded to two decimal places, which is 3.14

1
Expert's answer
2021-07-19T02:55:40-0400
#include<iostream>
using namespace std;
int main(){
	int radius;
	double pi = 3.14;
	cout<<"Enter the radius of the circle\n";
	cin>>radius;
	cout<<"\nThe area of the circle is:  "<<pi * radius * radius;
}

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