0% found this document useful (0 votes)
5 views2 pages

Calculate Circle Area with Friend Function

Uploaded by

akshayaarb24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Calculate Circle Area with Friend Function

Uploaded by

akshayaarb24
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PROGRAM CODE:

// Area of circle using Friend Function

#include<iostream>

using namespace std;

class circle

int radius;

public:

void get()

cout << "Enter the radius of Circle : ";

cin >> radius;

friend float calculate(circle ob);

};

float calculate(circle ob)

return 3.14 * [Link] * [Link];

int main()

cout<<"\t\t\tTHARUIKA J\n";

cout<<"\t\t\t25BIT058\n";

cout<<"\t\t\tProgram 6 : Program to Implement Area of circle using Friend Function\n";

cout<<"\t\t\t*****************************************************\n";

circle c;

[Link]();

cout<<"\nArea of Circle : "<<calculate(c);

}
OUTPUT:

THARUIKA J

25BIT058

Program 6 : Program to Implement Area of circle using Friend Function

*****************************************************

Enter the radius of Circle : 6

Area of Circle : 113.04

You might also like