(HELP) Computing area of circle using function call by reference

How to make this as call by reference?

#include <iostream>
using namespace std;


float areaOfCircle(float&);

int main() {
float radius;


cout << "Enter the radius of circle: ";
cin >> radius;

cout << "Area of circle: " << areaOfCircle(radius) << endl;

return 0;
}


float areaOfCircle(float radius_circle)
{
float area_circle;
area_circle = 3.14 * radius_circle * radius_circle;

return area_circle;
}
Last edited on
Post it in the jobs section.
Topic archived. No new replies allowed.