Answer to Question #48789 in C++ for ama nae

Question #48789
Convert the program to calculate the area and circumference of the circle into function by reference code.
1
Expert's answer
2014-11-11T00:37:29-0500
#include <iostream>
using namespace std;
void CalculateAreaCircumference(float radius, float &area, float &circumReference)
{

circumReference = 2 * 3.14 * radius;
area = 3.14 * radius * radius;
}
int main()
{
float radius, area, circumReference;
cout<<"Enter the radius of the circle ";
cin>>radius;
system("cls");
CalculateAreaCircumference(radius, area, circumReference);
cout<<"Area of the circle : "<<area<<endl<<endl;
cout<<"Circumreference of the circle : "<<circumReference<<endl<<endl;
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
APPROVED BY CLIENTS