Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int weight_pound, height_inch;
- float result, bmi, height_square;
- printf("Enter your height in whole inch: ");
- scanf("%d",&height_inch);
- printf("Enter your weight in whole pound: ");
- scanf("%d",&weight_pound);
- height_square=height_inch*height_inch;
- result = weight_pound/height_square;
- bmi = result * 703;
- printf("Your BMI is %0.1f\n",bmi);
- if (bmi<18.5)
- {
- printf("You are underweight");
- }
- else if (bmi >= 18.5 && bmi <= 24.9 )
- {
- printf("You are normal weight");
- }
- else if (bmi >= 25 && bmi <= 29.9)
- {
- printf("You are under weight");
- }
- else
- {
- printf("You are obese");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement