Advertisement
DrAungWinHtut

bmi.c

May 7th, 2023
861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include<stdio.h> //printf() scanf()
  2. int main()
  3. {
  4.     float bmi;
  5.     float w;
  6.     float h;
  7.  
  8.     printf("enter w in lbs: ");
  9.     scanf("%f",&w);
  10.  
  11.     printf("enter h in inches: ");
  12.     scanf("%f",&h);
  13.  
  14.     bmi = (w / (h * h) ) * 703;
  15.  
  16.     printf("your bmi is %f\n",bmi);
  17.  
  18.     if(bmi<=18.4)
  19.     {
  20.         printf("underweight\n");
  21.     }
  22.     if((bmi>18.4) && (bmi<25.0))
  23.     {
  24.         printf("normal\n");
  25.     }
  26.    
  27.     if((bmi>=25) && (bmi<40.0))
  28.     {
  29.         printf("overweight\n");
  30.     }
  31.     if(bmi>=40.0)
  32.     {
  33.         printf("obese\n");
  34.     }
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement