Created
February 21, 2012 20:18
-
-
Save lucasrenan/1878632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Lucas Renan TP072167 | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <dos.h> | |
float CalculaPeso(float Altura, float Peso) | |
{ | |
float Calcula; | |
Calcula = Peso / (Altura * Altura); | |
return (Calcula); | |
} | |
int main(void) | |
{ | |
float Resultado, Altura, Peso; | |
printf("Digite a altura (m): "); | |
scanf("%f", &Altura); | |
printf("\nDigite o peso (Kg): "); | |
scanf("%f", &Peso); | |
Resultado = CalculaPeso(Altura, Peso); | |
if(Resultado < 18.5) | |
{ | |
printf("\n\nO IMC eh: %f. Estah subnutrido!\n\n\n", Resultado); | |
} | |
if(Resultado >= 18.5 && Resultado < 25) | |
{ | |
printf("\n\nO IMC eh: %f. Estah normal.\n\n\n", Resultado); | |
} | |
if(Resultado > 25 && Resultado <= 30) | |
{ | |
printf("\n\nO IMC eh: %f. Estah com sobrepeso.\n\n\n", Resultado); | |
} | |
if(Resultado > 30 && Resultado <= 40) | |
{ | |
printf("\n\nO IMC eh: %f. Estah obeso!\n\n\n", Resultado); | |
} | |
if(Resultado > 40 && Resultado <= 50) | |
{ | |
printf("\n\nO IMC eh: %f. Estah com obesidade morbida!\n\n\n", Resultado); | |
} | |
if(Resultado > 50) | |
{ | |
printf("\n\nO IMC eh: %f. Estah super obeso!!!\n\n\n", Resultado); | |
} | |
system("pause"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment