what is wrong in this code..

#include<stdio.h>
int main()
{
int n1;
float n2,n3;
scanf("%d%f",&n1,&n2);
if(n1>0&&n2>=0)
{
if(n2<=2000&&n1<=2000)
{
if(n1%5==0&&n1<n2)
{
n3=n2-n1-0.5;
printf("\n%.2f\n",n3);
}
}
}
else
printf("\n%.2f\n",n2);

 return 0;
}

the problem is your n3 variable can reach negative values.

try with n1 = 0, n2 = 0.1

n3 = -.4

i thiknk you didn’t intended that way. :slight_smile:

Can you state the problem with input and output