Why is my solution being shown as wrong for the HS08TEST?

#include <stdio.h>
#include <math.h>
int main ()
float a,b,c;
scanf ("%f f",&a,&b); c=fmod (a,5); if (c==0 && b>a) {a+=0.50;printf (".2f",b-a);}
{printf ("%.2f",b);}
return 0;


According to the problem, for a transaction to take place, current balance >= withdraw amount + bank charge.

i.e. b >= a + 0.5, but you have written b > a. So, do the appropriate changes and your code will get Accepted (AC).

1 Like

Thank you so much,sir.You saved my life.It got accepted.