It works well on my computer, but codechef shows Wrong answer. New to this community, so help me out here, and do let me know the mistake I’m making. Thanks in advance
I’m having trouble with this one myself.
A thing I forgot withdraw<credit
also output give a number with single digit after the dot.
I need to get a double digit after the dot
I recommend you don’t use many fuctions in a short programme, as it’ll be susceptble to many compilation, syntactical or sometimes, very subtle logical errors.
Just take the inputs in the main functions…even if you don’t contraint their values to a maximum of 2000 (but input such), your code will be fine. Then, check the divisibility by 5 and then check whether the balance is greater than the ATM fees (0.5) + the withdrawal amount. If this is true, subtract the amount from balace and output the new balance. The code is much shorter than this one and less confusing.