Pooja would like to withdraw X $US from an ATM. The cash machine will only accep

#include<stdio.h>

int main(){

float y,output;

int x;

printf(“enter the amount you wish to withdraw and the balance in your account : \n”);

scanf("%d %f",&x, &y);

printf("%d %.2f\n ",x,y);

if(x%5!=0){

printf("output : \n %.2f \n",y);

}

else{

output = y-x-0.5;

printf("output : \n %.2f ",output);

}

return 0;

}
my solution is wrong i dont understand why

You are getting wrong answer because you are not considering case of “Insufficient Funds”.

if(x%5!=0 || y<x+0.5){

printf("output : \n %.2f \n",y);
}

else{

output = y-x-0.5;

printf("output : \n %.2f ",output);
}

with this conditions you will get correct answer