I was trying to run a program but it shows an error as:
Invalid binary operator float to int
When I tried making it float
it says:
Invalid binary operator float to float
The problem is with %
operator And its operands.
Please tell me what to do?
#include <stdio.h>
int main()
{
float x,y;
scanf("%f%f",&x,&y);
float z=x%5.0f;
if(x<=y && z==0)
printf("%.2f",y-x-0.50);
else if (x>y || z!=0)
printf("%.2f",y);
return 0;
}