Aren’t you taking input in the opposite manner? The first input is a +ve(x in your case) integer and second is a float number(y). As your code says, x is the amount you need to withdraw and y is the total money in the account. That’s why you have done x+0.5<=y!
Thus, you are taking reverse input and this is the mistake in your code. Here is your AC
Bro your code give output 30.0000 instead of 89.50.so you can say there is something wrong with the algorithm.you can use any ide or or online compilers to check output. ideone.com is good.and one more thing your output in this problem must have exact 2 decimal places…89.5 wont work so if you are using C so use %.2f instead of %f.