Class And Object

in Hindi - Class And Object



not yet

Source Code :

RUN#include <iostream>
using namespace std;

class Addition{

int a, b, c;

public :
void getdata();
void putdata();
};

void Addition :: getdata(){
cout<<"Enter a and b";
cin>>a>>b;
}
void Addition :: putdata(){
c=a+b;
cout<<"Addition of a and b is "<<c;
}
int main(){
Addition Object;
Object.getdata();
Object.putdata();

return 0;
}