ATM problem in C