What is the problem in my code? I am getting wrong answer while submitting the code.
the problem statement says:
Output the account balance after the attempted transaction, given as a number with two digits of precision. If there is not enough money in the account to complete the transaction, output the current bank balance.
So check for example the input
Your program returns -0.4, which should not be possible.