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 - 502Mp - Online C++ Compiler & Debugging Tool - Ideone.com :wink:

1 Like

you should return zero …

1 Like

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

this is valid, but this time he got AC without it (CodeChef: Practical coding for everyone), strange

yups…quite strange…:x