atm..wrong answer..cannot find the reason..

Below is the code that i wrote but it always shows"wrong answer" when i submit it.Can some please tell me what is wrong in it? thanx in advance…

#include <iostream>
#include <iomanip> 
using namespace std;
 
int main()
{
    int x;
   float y;
   cin>>x;//withdraw
   cin>>y;//balance

   if(x<0||x>2000||y<0||y>2000)
     return 0;
   if(x>y)
     { cout.precision(2);
       cout<<fixed<<y;
     }
   else
     { if (x%5==0)
         {   cout.precision(2);
             cout<<fixed<<y-x-0.50;
         }
       else
         
         {   cout.precision(2);
             cout<<fixed<<y;
         }
     }   
   return 0;
 
}

What’s Wrong:
The condition in your answer: if(x>y)

Hint:
Keep in mind there’s always a charge of 0.50$ on withdrawal.

2 Likes

@rakshify thank you…