Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void main()
- {
- int money;
- float tax = 0;
- printf("enter money: ");
- scanf("%d", &money);
- if (money > 1)
- {
- tax = money * 0;
- }
- if (money > 150000)
- {
- tax = 150000 * 0 + ((money-150000) * 0.05);
- }
- if (money > 300000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + ((money - 300000) * 0.10);
- }
- if (money > 500000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + (200000 * 0.10) + ((money - 500000) * 0.15);
- }
- if (money > 750000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + (200000 * 0.10) + (250000 * 0.15) + ((money - 750000) * 0.20);
- }
- if (money > 1000000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + (200000 * 0.10) + (250000 * 0.15) + (250000 * 0.20) + ((money - 1000000) * 0.25);
- }
- if (money > 2000000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + (200000 * 0.10) + (250000 * 0.15) + (250000 * 0.20) + (1000000 * 0.25) + ((money - 2000000) * 0.30);
- }
- if (money > 4000000)
- {
- tax = 150000 * 0 + (150000 * 0.05) + (200000 * 0.10) + (250000 * 0.15) + (250000 * 0.20) + (1000000 * 0.25) + (2000000 * 0.30) + ((money - 4000000)*0.35);
- }
- printf("Tax = %.0f\n", tax);
- printf("Tax Rate = %.2f%%\n", (tax*100)/money);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement