nikolas_serafini

Lista 2 - Exercício 25

May 25th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float hei;
  7.     char sex;
  8.  
  9.     printf("Entre com o sexo do individuo : (H/M)\n"); sex = getche();
  10.     printf("\nEntre com a sua altura : \n"); scanf("%f",&hei);
  11.  
  12.     if (sex == 'H')
  13.     {
  14.         printf("Peso ideal = %f\n",(72.7*hei)-58);
  15.     }
  16.     else if (sex == 'M')
  17.     {
  18.         printf("Peso ideal = %f\n",(62.1*hei)-44.7);
  19.     }
  20.     else printf("SEXO INEXISTENTE (hue)\n");
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment