Untitled
unknown
plain_text
3 years ago
522 B
12
Indexable
#include <stdio.h>
float inputIncome(){
float s = -1;
while (!(s > 0)){
printf("Input your valid income: ");
scanf("%f", &s);
}
return s;
}
int main()
{
float s, t;
s = inputIncome();
if (s > 4000){
t = (s - 4000) * 0.2 + 250;
} else if (s > 2000){
t = (s - 2000) * 0.1 + 50;
} else if (s > 1000){
t = (s - 1000) * 0.05;
} else {
t = 0;
};
printf("The tax T is %f corresponding to your %f income", t, s);
return 0;
}Editor is loading...