Sir, I have a problem regarding my first question in my code chef…

For ATM problem,

Pooja would like to withdraw X $US from an ATM. 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). For each successful withdrawal the bank charges 0.50 $US. Calculate Pooja’s account balance after an attempted transaction.(For this question)

I have answered in the following way,

#include

using namespace std;

int main()

{

int x,y,r;

cout<<"Enter balance : ";

cin>>y;

cout<<"Enter the amount to be withdrawn : ";

cin>>x;

r=(x%5);

if((r==0)&&y>(x+0.50))

{

y=(y-x)+0.50;

cout<<"Remaining balacne = "<<y;

}

else

cout<<"Remaining balance = "<<y;

return 0;

}

I am not able to find any mistake in my answer… Can u please help me out of this problem??