CONSTRUCTOR PROGRAM
#include <iostream>
using namespace std;
class mark
{
public:
int a,b,c;
int total;
mark()
{
total=0;
}
void getdata()
{
cout<<"enter the marks";
cin>>a;
cin>>b;
cin>>c;
}
void putdata()
{
total=a+b+c;
cout<<total;
}
};
int main()
{
mark obj;
obj.getdata();
obj.putdata();
return 0;
}
Comments
Post a Comment