I'm very new to C, and I'm trying to write a simple program that calculates the amount of taxes owed based on gross income and tax rate. I have no idea why owedTax prints as 0 with the following inputs.
#include <stdio.h>
int main()
{
// get user's AGI
double userAGI;
printf("enter agi:\n");
scanf("%lf",&userAGI)
// get tax rate
int taxRate;
printf("enter desired tax rate:\n");
scanf("%d",&taxRate);
// calculate owed tax
double owedTax = (taxRate / 100) * userAGI;
printf("%lf\n",owedTax);
return 0;
}
Ouput:
enter agi:
100
enter desired tax rate:
10
0.0000000
Why does owedTax print as 0?