//Write aprogram to illustrate the concept of friend function

| |


#include<iostream.h>
#include<conio.h>
class demo
{
int x;
public:
demo(int xx)
{ x=xx;
}
friend void display(demo);
};
void display(demo dd1)
{ cout<<"Value of demo is: "<<dd1.x;
}
int main()
{ clrscr ();
demo d1(5);
display(d1);
return 0;
}
<