You are checking the mentioned conditions separately so it will work as OR operation that is if either entered amount is divisible by 5 OR the entered amount can be withdrawn, it will account for the successful transaction but it should not.
So instead take AND operation i.e. move your second if-else block inside the first if block which will lead to t=0 only when first the amount can br withdrawn and then check if it is divisible by 5 not.