0
I am starting to program now and I have a problem in the example below. The question asks to calculate the income tax, according to the salary received by the person. The mistake is that, regardless of the amount of salary I put as input, the program prints "exempt", even for values that surpass the intevalo relative to the exemption.
include
int main (){
double salario, aux1, aux2, aux3;
printf("digite seu salario: ");
scanf("%lf", &salario);
if(salario>=0.00 || salario<=2000.00){
printf("Isento");}
else {if(salario>=2000.01 || salario<3000.00){
aux1=salario*0.08;
printf("O valor a ser pago e %.2lf", &aux1);}
else {if(salario>=3000.01 || salario<=4500.00){
aux2=salario*0.18;
printf("o valor a ser pago e %.2lf", &aux2);}
else {if(salario>=4500.01){
aux3=salario*0.28;
printf("O valor a ser pago e %.2lf", &aux3);}
}
}
}
return 0;
}
Wow, really. I had not attempted it. Thank you so much!
– use_-44-18