Untitled
unknown
plain_text
2 years ago
430 B
8
Indexable
#include <iostream>
using namespace std;
class Calculate{
private:
int a;
int b;
public: Calculate(int x,int y){
a=x;
b=y;
}
void display(){
int s=a+b;
cout<<"Sum is: "<<s;
}
};
int main()
{
int m,n;
cout<<"Enter two number";
cin>>m>>n;
Calculate ob(m,n);
ob.display();
return 0;
}
Editor is loading...
Leave a Comment