getting error

IN visual studio output window successfully compiled , but getting error while compiling in code chef

Please tell me your code, after that I will be able to give any suggestion.

You are getting WA because of the statement cout<<“enter amount to be drawn,initial amount:”;.

First read this link : How does Codechef test whether my solution is correct or not

The output generated by your program must match the correct output exactly in order to be judged correct. In your case it is not matching the output exactly.
In the problem statement it states that the output file must contain only the current balance.

In your solution, the output generated by your code is two lines,which are as follows:

enter amount to be drawn,initial amount:

current balance(the float value as per the solution)

but it should be only be containing one line, which is as follows:

current balance(the float value as per the solution)




Also, there is also a problem in the logic used, which will lead to Wrong answer.

You need to check if(amt>init-0.50)

After removing the errors mentioned above, your code should work. Also, there is a small request, make sure that you provide the url(link) of your solution with the question asked, it is easier for us to help you.

Happy coding

Cheers

//