Body Mass Index (BMI) is a measure of health based on height and weight. You can calculate your BMI by taking your weight in kilograms and dividing it by the square of your height in meters

 Body Mass Index (BMI) is a measure of health based on height and weight. You can calculate

your BMI by taking your weight in kilograms and dividing it by the square of your height in

meters. The interpretation of BMI for people 20 years or older is as follows:

BMI Interpretation

BMI < 18.5 Underweight

18.5 <= BMI < 25.0 Normal

25.0 <= BMI < 30.0 Overweight

30.0 <= BMI Obese



#include<iostream>

using namespace std;


int main()

{

//weight in kilograms

float kilograms;

//height in meters

float meters;

//enter the values

cout<<" enter your weight in kilograms ";cin>>kilograms;

cout<<" enter your height in meters ";cin>>meters;

//calculate BMI

//formula: weight in kilo / (height in meter)*(height in meter)

float BMI = kilograms / (meters*meters);

cout<<" your BMI is "<<BMI<<endl;

if(BMI<18.5)

{

//BMI < 18.5 Underweight

cout<<" you are under weight";

}

else if(18.5<= BMI && BMI<25)

{

//18.5 <= BMI < 25.0 Normal

cout<<" you are normal";

}

else if(25<= BMI && BMI<30)

{

//25.0 <= BMI < 30.0 Overweight

cout<<" you are Overweight";

}

else

{

//30.0 <= BMI Obese

cout<<" you are Obese";

}

return 0;

}



output:-

enter your weight in kilograms 50

 enter your height in meters 1.72

 your BMI is 16.901

 you are under weight

-------------------------------------------

enter your weight in kilograms 60

 enter your height in meters 1.72

 your BMI is 20.2812

 you are normal

------------------------------------------

 enter your weight in kilograms 80

 enter your height in meters 1.72

 your BMI is 27.0416

 you are Overweight

-------------------------------------------

 enter your weight in kilograms 90

 enter your height in meters 1.72

 your BMI is 30.4218

 you are Obese

--------------------------------------------

Comments

Popular posts from this blog

Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas: area = radius * radius * π volume = area * length

Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

Write a program that prompts the user to enter the min- utes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days