Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main(){
- double value;
- float tax;
- printf("Ange taxeringsvärdet: ");
- scanf_s("%f", &value);
- if(value <= 450000)
- tax = value * 0.02;
- else
- if(value < 600000)
- tax = (value - 450000) * 0.04 + 450000 * 0.02;
- else
- if(value < 750000)
- tax = (value - 600000) * 0.06 + 150000 * 0.04 + 450000 * 0.02;
- else
- tax = (value - 750000) * 0.08 + 150000 * 0.06 + 150000 * 0.04 + 450000 * 0.02;
- printf("%d ger %f i skatt.", value, tax);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement