I tried ATM problem using c. I am also pretty sure my logic is correct,but there seems to be a minute detail that i have missed.I keep getting my code is worng.
Please help.
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
float wit,bal;
scanf("%f %f",&wit,&bal);
if(wit>=bal)
{
printf("%0.2f",bal);
exit(0);
}
if(fmod(wit,5)!=0)
{
printf("%0.2f",bal);
exit(0);
}
else
{
bal=(bal-wit)-0.50;
printf("%0.2f",bal);
}
return 0;
}