Skip to content

Instantly share code, notes, and snippets.

@dibakarsutradhar
Created September 14, 2018 07:08
Show Gist options
  • Save dibakarsutradhar/444bb0d51eb65eaae6806a4d94c7db9a to your computer and use it in GitHub Desktop.
Save dibakarsutradhar/444bb0d51eb65eaae6806a4d94c7db9a to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class abstraction {
private:
int a, b;
public:
void set(int x, int y) {
a = x;
b = y;
}
void display() {
cout << "a = " << a <<endl;
cout << "b = " << b <<endl;
}
};
int main() {
abstraction obj;
obj.set(1, 2);
obj.display();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment