if((int)a%5==0 && a<=f)
In if statement you have to write a<=f-0.5
and also return 0 at the end as it might give you runtime error.
Try executing your code on this test case:
Your code will print:
So you need to check that (withdrawal amount + 0.5 (Transaction fees) ) <= amount in bank.