viewing paste Unknown #17389 | 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 26
#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 ("Your Amount After Tax Is : $%.2f\n\n", (income - tax));
 
    return 0;
}
 
Viewed 288 times, submitted by unknown.