Untitled
unknown
plain_text
2 years ago
367 B
3
Indexable
#include<iostream>
using namespace std;
class sample
{
private:
int a;
int b;
friend float mean(sample s);
public:
void setvalue()
{
a = 25;
b = 40;
}
};
float mean(sample s)
{
return float(s.a + s.b)/2;
}
int main(){
sample x;
x.setvalue();
cout<<"Mean Value="<<mean(x);
return 0;
}
Editor is loading...
Leave a Comment