Why this successfully executed code is showing wrong?

#include <stdio.h>
int main()
{int intial, withdraw;
scanf("%d",&withdraw);
scanf("%d",&intial);
if (withdraw%5==0 && withdraw<=intial-0.5)
printf("%f", intial-withdraw-0.5 );
else
printf("%d", intial);
return 0;}

use double instead of int and use String.Format("%0.2f",val) for 2 decimal after integer
i did this in java so use according to C.
int value dont give decimal values,
example int a=4;
printf("%d",a-0.5);
will give 3 as answer not 3.5 cause it is integer