class A {
int num; // private by default
public:
void set_num(int digit) { num = digit; }
int get_num() const { return num; }
};
int main()
{
A obj;
int digit = 0;
std::cout << "Enter a digit"
std::cin >> digit;
std::cin.ignore();
obj.set_num(digit);
std::cout << "num in obj is " << obj.get_num();
return 0;
}