What is error in code? Problem Code: HS08TEST

#include<stdio.h>
int main()
{
int b; float t;
scanf("%d%f",&b,&t);
if(b%5==0)
{
if (b<t)
{ float i;
i=(t-b)-.50;
printf("%f",i);}
else if(b>t)
{printf("%f",t);}}
else{printf("%f",t);}
return 0;
}

Your code is perfect

You have to output the result with two digits of precision.

Modify these lines printf("%f", i);
to → printf("%0.2f", i);

2 Likes