Help me in ATM beginners section

#include <stdio.h>

int main(void) {
	int x;
	float y;
	scanf("%d %f",&x,&y);
	if(x<=2000&&x>0&&y<=2000&&y>=0)
	{
		if (x>y||x%5!=0)
	{
		printf("%f",y);
	}
	else if (x+0.5<=y)
	{
		printf("%f",y-x-0.5);
	}
	}
	return 0;
}

cant really figure out what I’m doing wrong please help

Hi @negativ3,

  1. You are not considering the two-digit precision part into account.
  2. Not considering the charges during the case of failed transactions. Like for input 120 120.10 your code is printing nothing.

Here is the corrected code:CodeChef: Practical coding for everyone .
Hope this helps!