# Answer to Question #31204 in C++ for ihab

Question #31204

Write a program to calculate area of circle using friend function ?

Expert's answer

#include <iostream>

#include <math.h>

using namespace std;

int area(double R)

{

double AREA2=0;

double Pi=3.14159265358979;

AREA2= Pi*R*R;

cout<<AREA2;

}

int main()

{

double r;

cout<<"enter R"<<endl;

cin>>r;

area(r);

return 0;

}

#include <math.h>

using namespace std;

int area(double R)

{

double AREA2=0;

double Pi=3.14159265358979;

AREA2= Pi*R*R;

cout<<AREA2;

}

int main()

{

double r;

cout<<"enter R"<<endl;

cin>>r;

area(r);

return 0;

}

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment