Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- int main ()
- {
- int contador=1;
- float soma_homens=0.0, soma_mulheres=0.0;
- float media_homens, media_mulheres;
- float altura;
- int sexo;
- while (contador <= 50)
- {
- printf ("Qual sua altura? \n");
- scanf ("%f", &altura);
- printf (" ------------------- \n");
- printf ("Qual seu sexo?\n");
- printf (" 1. Sexo Masculino \n");
- printf (" 2. Sexo Feminino \n");
- printf (" ------------------- \n");
- scanf ("%d", &sexo);
- switch (sexo)
- {
- case 1:
- printf ("Sexo Masculino \n");
- printf (" ------------------- \n");
- soma_homens == (soma_homens + altura);
- printf("%d ", soma_homens);
- break;
- case 2:
- printf ("Sexo Feminino \n");
- printf (" ------------------- \n");
- soma_mulheres == (soma_mulheres + altura);
- printf("%d ", soma_mulheres);
- break;
- }
- contador++;
- }
- media_mulheres == (soma_mulheres) / 50;
- media_homens == (soma_homens) / 50;
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement