#include<iostream.h>
#include<conio.h>
class fr
{
int a,b;
public:
friend int sum(fr x);
void set(int i,int j);
};
void fr::set(int i,int j)
{
a=i;
b=j;
}
//sum() here is not a member of any class
//since this function is friend of class fr it directly acess a and b
int sum(fr x)
{
return x.a+x.b;
}
void main()
{
clrscr();
fr ob;
ob.set(9,8);
cout<<sum(ob);
getch();
}