Untitled
Anonymous
plain_text
04/15/2024 6:02 AM
576 B
18
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