Advertisement
Layla_s_Layla

Untitled

Oct 30th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <conio.h>
  4. int main ()
  5. {
  6. int contador=1;
  7. float soma_homens=0.0, soma_mulheres=0.0;
  8. float media_homens, media_mulheres;
  9. float altura;
  10. int sexo;
  11.  
  12. while (contador <= 50)
  13. {
  14. printf ("Qual sua altura? \n");
  15. scanf ("%f", &altura);
  16. printf (" ------------------- \n");
  17. printf ("Qual seu sexo?\n");
  18. printf (" 1. Sexo Masculino \n");
  19. printf (" 2. Sexo Feminino \n");
  20. printf (" ------------------- \n");
  21. scanf ("%d", &sexo);
  22.  
  23. switch (sexo)
  24. {
  25. case 1:
  26. printf ("Sexo Masculino \n");
  27. printf (" ------------------- \n");
  28. soma_homens == (soma_homens + altura);
  29. printf("%d ", soma_homens);
  30. break;
  31.  
  32. case 2:
  33. printf ("Sexo Feminino \n");
  34. printf (" ------------------- \n");
  35. soma_mulheres == (soma_mulheres + altura);
  36. printf("%d ", soma_mulheres);
  37. break;
  38. }
  39.  
  40. contador++;
  41. }
  42. media_mulheres == (soma_mulheres) / 50;
  43. media_homens == (soma_homens) / 50;
  44.  
  45. getch();
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement