Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- double wt_lb, ht_in, bmi, ht_ft;
- printf("Please enter your weight: ");
- scanf("%lf", &wt_lb);
- printf("Please enter your height: ");
- scanf("%lf", &ht_in);
- ht_ft = ht_in/12;
- bmi = (703*wt_lb)/(ht_ft*ht_ft);
- if (bmi < 18.5) {
- printf("You have a BMI of %.1f, and your weight status is underweight\n",bmi);
- } else if (bmi >= 18.5 && bmi < 25) {
- printf("You have a BMI of %.lf, and your weight status is normal\n",bmi);
- } else {
- printf("You have a BMI of %.lf, and your weight status is overweight\n",bmi);
- }
- else if (bmi>30){
- printf("You have a BMI of %.1f, and your weight status is Obese\n",bmi);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement