#include<iostream>
using namespace std;
class sample
{
int a,b;
public:
void getdata()
{
cout<<"Enter the value of a and b"<<endl;
cin>>a>>b;
}
friend int mean(sample s)
{
int m=(s.a+s.b)/2;
return m;
}
};
int main()
{
sample s;
s.getdata();
cout<<" mean = "<<mean(s);
return 0;
}
using namespace std;
class sample
{
int a,b;
public:
void getdata()
{
cout<<"Enter the value of a and b"<<endl;
cin>>a>>b;
}
friend int mean(sample s)
{
int m=(s.a+s.b)/2;
return m;
}
};
int main()
{
sample s;
s.getdata();
cout<<" mean = "<<mean(s);
return 0;
}
No comments:
Post a Comment