I\'ve created an ATM like program which holds the money in a person\'s account. When the person takes out a withdrawal, it subtracts the withdrawal from the account along wi
int account = 2000;
printf("Remaining account: %.2f\n", account);
This is wrong; it should be "%d"
for integer, or better, change your account
variable type to something that could represent the 0.50 you're surcharging. I don't recommend you to using (imprecise) float
s for money either. You don't want to withdraw 10.499999997
when you meant 10.5
. You need to think about the precision and rounding rules you'd use. AFAIK these are both mandated by laws or something.