#include using namespace std; class MyInfo { private: // data hidden from outside world int x; public: // function to set value of variable x void set(int a) { x = a; } // function to return value of variable x int get() { return x; } }; // main function int main() { MyInfo obj; obj.set(5); cout << obj.get(); // cout is used inspite of printf() return 0; }