ATM question

Whats wrong with this code… its showing wrong answer… No compilation error.

#include<iostream>

using namespace std;
int main()
{
    int with;
    double bal;
    cin>>with>>bal;
    if(with<bal)
    {
                if((with%5)==0)
                {
                             bal=bal-with;
                             bal=bal-0.50;
                             printf("%.2f",bal);
                }
                else
                printf("%.2f",bal);
    }
    else
    printf("%.2f",bal);
}

Look here - http://ideone.com/502Mp :wink:

1 Like

Thanxx Dude…
Blunder mistake it was…!
:stuck_out_tongue:

you should return zero …

1 Like

this is valid, but this time he got AC without it (http://www.codechef.com/viewsolution/1479129), strange

yups…quite strange…:x