My code for the problem- ATM is giving error.

I compiled my C code with the sample examples and I was getting the desired output but every time I submit the code, the code gets rejected as wrong answer. The question name is ATM. Here is the link to the question: https://www.codechef.com/problems/HS08TEST
Here is my code:

#include <stdio.h>
int main()
{   float sum, balance;
int withdraw;
sum = 0.00;
scanf("\n %d %f", &withdraw, &balance);

if(((withdraw%5) == 0) && (withdraw<=balance))
{   sum = (balance - (float)withdraw - 0.5);
    printf("%.2f", sum);
}
else
{ printf("%.2f", balance); }

return 0;
}

It should be withdraw + 0.5 <= balance in if statement after && :slight_smile:

//