Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

how is my ans wrong ?

$
0
0

//atm

include<iostream>

using namespace std; int main() { float bal=120.00; int i,j; float rec; cout<<"\n Your current balance is 120 Rupees only ! \n Enter your withdrawal Amount "; cin>>i; if(i>bal) {

{
    cout<<"\n Insufficient Balance ! ";
    rec=bal;
}
}
else
{


if(i%5==0)
{
    cout<<"\n Transaction successful !!";
    rec=bal-i-0.50;
}
else if(i%5!=0)
{
    rec=bal;
}
}
cout<<"\n Your balance after transaction is : "<<rec;
return 0;

}


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>