Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main (void){
- float weight, height;
- printf("Enter the weight (pounds): ");
- scanf("%f", &weight);
- printf("Enter the height (inches): ");
- scanf("%f", &height);
- float BMI = 703 * (weight / (height * height));
- if (BMI >= 18.5 && BMI <= 24.9){
- printf("The BMI is %.1f (normal weight)", BMI);
- }
- else if (BMI >= 25 && BMI <= 29.9){
- printf("The BMI is %.1f (overweight)", BMI);
- }
- else if (BMI < 18.5){
- printf("The BMI is %.1f (underweight)", BMI);
- }
- else if (BMI > 30){
- printf("The BMI is %.1f (obese)", BMI);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement