Untitled
unknown
plain_text
a year ago
367 B
2
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