Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.77 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include <ctype.h>
  5. #include <string.h>
  6. #include <stdbool.h>
  7.  
  8. int main()
  9. {
  10.     float tax, income;
  11.     printf("Enter your income: ");
  12.     scanf("%f", &income);
  13.  
  14.     if(income < 750){
  15.         tax = (1/100) * income;
  16.     }else if(income >= 750 && income <2250){
  17.         tax =  7.5 + ((2/100) * income);
  18.     }else if(income >=2250 && income < 3750){
  19.         tax = 37.5 + ((3/100) * income);
  20.     }else if(income>=3750 && income < 5250){
  21.         tax = 82.5 + ((4/100) * income);
  22.     }else if(income>=5250 && income<=7000){
  23.         tax = 142.5 + ((5/100) * income);
  24.     }else if(income > 7000){
  25.         tax = 230 + ((6/100) * income);
  26.     }
  27.  
  28.     printf("\n\nThe tax to be paid is $ %.2f.", tax);
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement