Input
Output
#include <iostream> using namespace std; class Rectangle{ private: int length=5, breadth=6; float area; public: void get_data(); //member function friend void show_data(Rectangle); //friend function }; void Rectangle::get_data() { cout << "Enter the length and breadth value: " ; cout << length << " " << breadth << endl; area= length * breadth; } void show_data(Rectangle r1) { cout << "Area of the Rectangle: " << r1.area; } int main(){ Rectangle r1; r1.get_data(); //member function call using object show_data(r1); //friend function call without object return 0; }