Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- float pesoIdeal(float h, char sexo){
- printf("The Ideal Weight(PI) is: ");
- if (sexo == 'M'){
- float PI = (72.7 * h) - 58;
- return PI;
- }
- else {
- float PI = (62.1 * h) - 44.7;
- return PI;
- }
- printf("\n");
- }
- int main(){
- float altura;
- float peso;
- char sexo;
- printf("Insira seu peso, altura e sexo: \n");
- scanf("%f",&peso);
- scanf("%f",&altura);
- scanf("%c",&sexo);
- float PI = pesoIdeal(altura, sexo);
- printf("%f", PI);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement