Help me in ATM

,

#include
#include
using namespace std;
int main(){
int with;
float bal;
cout<<“input”;
cin>>with>>bal;
if(with>=0 && bal>=0.00 && with<=2000 && bal<=2000.00 && bal!=with && bal>=with && ( (with+ 0.50)<bal ) && (with%5==0) )
{

        bal= bal- with-0.50;
       cout<<bal;
         }
         else
          cout<<bal;
return 0;
 
}    

i don’t know what is wrong with code. i have tried everything but it still says wrong answer

cout<<"input"

Dont print such superfluous statements. Its a machine checking if your output is an exact match of expected one or not. It will print WA on encountering such a case.

 (with+ 0.50)<bal

Is bank balance of 0 not allowed in the question? I think a balance of 0 is allowed :confused:

Exact input/output format should be maintained.
First, omit line cout<<“input”
Second, the output should be given corrected up to 2 decimal places. In C++, you can use setprecision
function in the header file . Check it out here :-

http://www.cplusplus.com/reference/iomanip/setprecision/

Just change your line cou<<bal to cout<<fixed<<setprecision(2)<<bal and it’ll get accepted :slight_smile: