Answer to Question #31204 in C++ for ihab

Question #31204
Write a program to calculate area of circle using friend function ?
1
Expert's answer
2013-05-28T11:01:48-0400
#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;
}

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