Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- /* 5. Calcule e exiba o percentual de homens e mulheres da sua turma. Solicite apenas os dados necessários. */
- int main()
- {
- float quantHomens,quantMulheres,total,porcentagemHomens,PorcentagemMulheres;
- printf("\n Digite a quantidade de homens e mulheres: ");
- scanf("%f %f",&quantHomens,&quantMulheres);
- total = quantHomens + quantMulheres;
- porcentagemHomens = (quantHomens/total)*100;
- PorcentagemMulheres = (quantMulheres/total)*100;
- printf("\n Percentual de homens: %.2f",porcentagemHomens);
- printf("\n Percentual de mulheres: %.2f",PorcentagemMulheres);
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement