What do you mean by 'it doesn't work'?
when I enter 3 numbers (value of balance,taking money, adding money) ,program shows negative digits with this message:
Error :Taking Money is more from Total Money
In the constructor
cout<<"Error=>>Value of balance is negative";
you shall change statement
balance = i;