Last active
December 13, 2018 22:06
-
-
Save ivanelson/7e740c626156163f069eb5e32f230ba1 to your computer and use it in GitHub Desktop.
if's aninhados em C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void main() { | |
| float salario; | |
| char temFilhos; | |
| printf("Digite o salario atual do funcionario: "); | |
| scanf("%f", &salario); | |
| printf("\nVoce possui Filhos? Digite 'S' ou 'N': "); | |
| scanf(" %c", &temFilhos); | |
| if (salario > 1500.00) { | |
| if (temFilhos == 'S') | |
| salario = salario * 1.05; | |
| salario = salario + ( salario * 0.08); // poderia ser * 1.1 ou 1.08 para 8% | |
| printf("Parabéns voce teve 8 porcento de aumento! O novo salario eh: %f \n", salario); | |
| } else { | |
| if (temFilhos == 'S') | |
| salario = salario * 1.05; | |
| salario = salario + (salario * 0.10); | |
| printf("Parabéns voce teve 10 porcento de aumento! O novo salario eh: %f \n", salario); | |
| } | |
| if (salario > 1500.00) { | |
| printf("\nSeu salario já eh bom, mas pode melhorar!!!!"); | |
| } else if (salario < 100 ) { | |
| printf("\nSeu salario eh baixo, merece ganhar mais"); | |
| } else { | |
| printf("\nVoce esta numa zona intermediaria"); | |
| } | |
| printf("\n"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment