2
A very interesting problem, the first two if
me return valid values, but the latter returns a value different from the desired one. What to do?
#include <stdio.h>
int main (void)
{
//declaracao de variaveis
float salario;
float final1; // 1 item
float final2; // 2 item
float final3; // 3 item
//inicio
printf("\nDigite o salario:R$ ");
scanf("%f", &salario);
if(salario<600.00)
printf("\nIsento da taxa de contribuicao!");
else
if(salario > 600.00 || salario <=1200.00)
{
final1 = salario * 0.2;
printf("\nA contribuicao sera de:R$ %2.f", final1);
}
else
if(salario > 1200.00 || salario <= 2000.00)
{
final2 = salario * 0.25;
printf("\nA contribuição sera de:R$ %2.f", final2);
}
else
if(salario > 2000.00)
{
final3 = salario * 0.3;
printf("\nA contribuição sera de:R$ %2.f", final3);
}
}
thank you very much. error due to my lack of attention!
– João Rosa
@Joãorosa dispo! and see the best way to say thank you on the link: How to say thank you in replies? I also advise you to do the Tour
– Luiz Augusto