Answer to Question #297321 in C++ for Abel

Question #297321

Write and test the function that calculate the are of circle returns the area of ‘a’ and


the circumference c of a circle with given radius r ?



1
Expert's answer
2022-02-13T11:07:24-0500




#include<iostream>




using namespace std;




void calculateAreCircle(double radius,double& area,double& circumference){
	const double PI=3.14;
	area=PI*radius*radius;
	circumference=2*PI*radius;
}


int main(){
	double radius,area,circumference;
	cout<<"Enter radius: ";
	cin>>radius;
	calculateAreCircle(radius,area,circumference);
	cout<<"\nArea: "<<area<<"\n";
	cout<<"Circumference: "<<circumference<<"\n";


	system("pause");
	return 0;
}

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