#include<iostream.h>
class Marks
{
int a;
int b;
int c;
public:
void setmarks()
{
cout<<"Enter Marks Of Subject ";
cin>>a>>b>>c;
}
friend int total(Marks m);
};
int total(Marks m)
{
return(m.a+m.b+m.c);
}
Void main()
{
Marks x;
x.setmarks();
cout<<total(x);
}
No comments:
Post a Comment