Advertisement
Automake

IMC

Oct 4th, 2018
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. int main() {
  5.     float P, A, IMC;
  6.     int idade;
  7.  
  8.  
  9.     printf("Digite sua idade:\n");
  10.     scanf("%d",&idade);
  11.     printf("Digite o seu peso:\n");
  12.     scanf("%f",&P);
  13.     printf("Digite a sua altura:\n");
  14.     scanf("%f",&A);
  15.  
  16.  
  17.         IMC = P / (A*A);
  18.         if (IMC < 26){
  19.             printf("O seu Indice de Massa Corporea e %.2f e esta Normal\n", IMC );
  20.             }
  21.            
  22.        if (IMC >=26 &&  IMC<30){
  23.            printf ("O seu Indice de Massa Corporea e %.2f e voce esta Obeso\n", IMC);
  24.            }
  25.        
  26.         if (IMC >=30){
  27.            printf("O seu Indice de Massa Corporea e %.2f e voce esta com Obesidade Morbida\n", IMC);
  28.            }
  29.  
  30.         if (idade>=18){
  31.         printf("Você é maior de idade",idade);
  32.     }
  33.             if (idade <18){
  34.                
  35.             printf("Você é menor de idade",idade);
  36.             }
  37.     {
  38.         return (0);
  39.                    
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement