What is wrong in this ATM code?

#include
using namespace std;

int main() {
int amt;
float bal;
cout<<"Enter amount to be withdrawn "<<endl;
cin>>amt;
cout<<"Enter account balance "<<endl;
cin>>bal;
if(amt%5==0 && (amt+0.50)<bal){
float remaining=amt+0.50;
bal=bal-remaining;
cout<<bal;
}
else{
cout<<bal;
}

return 0;

}IMG_20210803_112432

1 Like

Don’t use statements like "Enter amount to be withdrawn ". The online judge will treat this as an error. Simply perform the steps and calculations. Check your solution in custom input and compare it to the standard output.

1 Like

I tried excluding those statements true…but yet its showing wrong answer

include amt+0.5<=bal instead of amt+0.5<bal