@mithunmuru Leaving the logic behind, the very first thing that you should learn is indenting your code. Not only the code looks clean but it helps you to see through your code for logical and syntactical error but also helps other people you may ask for help.
Secondly you must understand that you don’t have to check the conditions given on the test cases. Like the this piece of code in your program -
if(a<=2000 && b<=2000 && a>0 && b>=0) is useless. You must think about your logic keeping in mind that the codechef judge will only give the given values as test cases and hence you don’t have to check for such conditions and write statements like these -
Now another thing to keep in mind while writing your program is output format. It is possible that your logic for a particular question is absolutely correct but the output format is wrong then no matter what you do you will get a wrong answer every time.
These were some basic things you should keep in mind. Regarding the error in your code the condition that you applied in a and b is wrong. Try to run your code for different varieties of test cases and check what should be the condition on a and b. Think hard on this line form the question - “The cash machine will only accept the transaction if X is a multiple of 5, and Pooja’s account balance has enough cash to perform the withdrawal transaction (including bank charges)”.