code is for ATM in practice->easy section
#include<stdio.h>
#include<stdlib.h>
main()
{
float z,y;
int x;
scanf("%d%f",&x,&y);
if (x>y||(x%5)!=0)
printf("%f",y);
else
{
z=y-x-0.50;
printf("%f",z);
}
return 0;
}
code is for ATM in practice->easy section
#include<stdio.h>
#include<stdlib.h>
main()
{
float z,y;
int x;
scanf("%d%f",&x,&y);
if (x>y||(x%5)!=0)
printf("%f",y);
else
{
z=y-x-0.50;
printf("%f",z);
}
return 0;
}
All these points are leading to wrong answer:
The correction is: if(x > y-0.5)||(x%5)!=0)
for that use printf as printf(".2f",y);** and **printf(".2f",z);
this will print only 2 digits after the decimal.
If you still get wrong answer, just comment below, I will help you out.
Happy Coding
Cheers!