Advertisement
Guest User

Bmi cal with obese

a guest
Jan 30th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. double wt_lb, ht_in, bmi, ht_ft;
  6.  
  7. printf("Please enter your weight: ");
  8. scanf("%lf", &wt_lb);
  9. printf("Please enter your height: ");
  10. scanf("%lf", &ht_in);
  11.  
  12. ht_ft = ht_in/12;
  13. bmi = (703*wt_lb)/(ht_ft*ht_ft);
  14.  
  15. if (bmi < 18.5) {
  16. printf("You have a BMI of %.1f, and your weight status is underweight\n",bmi);
  17. } else if (bmi >= 18.5 && bmi < 25) {
  18. printf("You have a BMI of %.lf, and your weight status is normal\n",bmi);
  19. } else {
  20. printf("You have a BMI of %.lf, and your weight status is overweight\n",bmi);
  21. }
  22. else if (bmi>30){
  23. printf("You have a BMI of %.1f, and your weight status is Obese\n",bmi);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement