my problem is, when i try to withdraw bigger than balance...it will display the remaining balance..it display negative..which is wrong..instead of display the msg "you have not enough money".
what's wrong with my code?
this is my code:::::
if (withdraw == 1)
{
bal=bal-100;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 2)
{
bal=bal-500;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 3)
{
bal=bal-1000;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 4)
{
bal=bal-2500;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 5)
{
bal=bal-5000;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 6)
{
bal=bal-10000;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
if (withdraw == 0)
{
gotoxy(25,15);
cout<<"Enter amount:";
gotoxy(39,15);
cin>>withdraw;
bal=bal-withdraw;
gotoxy(25,17);
cout<<"Your balance now is Php "<<bal;
}
else if (withdraw > bal)
{
gotoxy(24,16);
cout<<"The money you input is not enough.";
}