#include int main(void){ double Height, Weight, BMI; printf("Input your Height[cm]:"); scanf("%lf",&Height); printf("Input your Weight[kg]:"); scanf("%lf",&Weight); BMI = (10000.0)*Weight/(Height*Height); /* printf("Your BMI is %.1f. Underweight.\n", BMI); printf("Your BMI is %.1f. Normal.\n", BMI); printf("Your BMI is %.1f. Pre-obese.\n", BMI); printf("Your BMI is %.1f. Obese class.\n", BMI); */ /*Example 1*/ if(BMI < 18.5 ) printf("Your BMI is %.1f. Underweight.\n", BMI); if(BMI >= 18.5 && BMI < 25.0) printf("Your BMI is %.1f. Normal.\n", BMI); if(BMI >= 25.0 && BMI < 30.0) printf("Your BMI is %.1f. Pre-obese.\n", BMI); if(BMI >= 30.0 ) printf("Your BMI is %.1f. Obese class.\n", BMI); /*Example 2*/ if(BMI < 18.5) printf("Your BMI is %.1f. Underweight.\n", BMI); else if(BMI < 25.0) printf("Your BMI is %.1f. Normal.\n", BMI); else if(BMI < 30.0) printf("Your BMI is %.1f. Pre-obese.\n", BMI); else printf("Your BMI is %.1f. Obese class.\n", BMI); /*Example 3*/ if(BMI < 25.0){ if(BMI < 18.5) printf("Your BMI is %.1f. Underweight.\n", BMI); else printf("Your BMI is %.1f. Normal.\n", BMI); }else{ if(BMI < 30.0) printf("Your BMI is %.1f. Pre-obese.\n", BMI); else printf("Your BMI is %.1f. Obese class.\n", BMI); } return 0; }