#include <stdio.h>
int main()
{
float income;
printf("enter your annual income here:");
scanf("%f", &income);
if (income < 250000)
{
printf("no income tax"); /* code */
}
else if (income >= 250000 && income < 500000)
{
printf("your income tax will be:%f", 5 / 100 * income);
}
else if (income >= 500000 && income < 1000000)
{
printf("your income tax will be:%f", 20 / 100 * income);
}
else if (income >= 1000000)
{
printf("your income tax will be:%f", 30 / 100 * income);
}
return 0;
}
When I run the code, entering values more than 250000, I still get 0 as my tax output, even though I have used the float
data type.