viewing paste Unknown #17390 | C

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include  <stdio.h>
int main (void) {
    float salary;
    float income;
    float tax = 0.0;
 
    printf("Please enter your salary amount: ");
    scanf("%f", &salary);
 
    printf("Your income (in dollars): ");
    scanf ("%f", &income);
 
    if(salary >= 100000) {
        if((income > 50000) && (income <= 100000))
            //get 5% tax
            tax = ((income / 100) * 5);
        else if(income > 100000)
            //get 7%
            tax = ((income / 100) * 7);
    }
    printf("\n\nYour Total Tax Deductions Are : $%.2f\n", tax);
    printf ("Your Total Amount After Tax Is : $%.2f\n\n", (income - tax));
       
    return 0;
}
Viewed 326 times, submitted by unknown.