#include<iostream.h>
#include<conio.h>
class biggest
{
private :
int a, b, c, large;
public :
void getdata();
friend int big (biggest abc); // friend function declared
};
void biggest :: getdata ()
{
cout<<"Enter any three numbers : "<<endl;
cin>>a>>b>>c;
}
int big(biggest abc)
{
abc.large = abc.a; // accessing of private data members
if (abc.b > abc.large)
{
abc.large = abc.b;
}
if (abc.c > abc.large)
{
abc.large = abc.c;
}
cout<<endl<<"The biggest of the entered numbers is : "<<abc.large;
return 0;
}
int main()
{
class biggest obj;
clrscr();
obj.getdata();
big(obj); // calling of friend function
getch();
return 0;
}