class mycls {int a,b; public: mycls(int m, int n) {a=m; b=n;} friend int Fn(mycls ob); }; int Fn(mycls ob) {mycls=temp; temp.a=temp.a*temp.a; temp.b=temp.b*temp.b; return temp; } int main() {mycls ob1(10,13), ob2(0,0); ob2=Fn(ob1); return 0; } /*---------------------*/ class mycls {int a,b; public: mycls(int m, int n) {a=m; b=n;} friend int Fn(mycls ob); }; int Fn(mycls ob){return a+b;} int main() {mycls ob1(10,15); int res; res=Fn(ob1); return 0; } /*---------------------*/ class mycls {int a,b; public: void set(inti, int j) {a=i; b=j;} void show() {cout< {MyCls ob1; YourCls ob2; ob1.set(10,5); ob2=ob1; ob1.show(); ob2.show();} /*---------------------*/