Calculate with C++.
Calculate BMI
( Using Metric Measurements)
height: 152 centimeters=1.52meters
square of height: (1.52 x 1.52 )m2
= 2.31m2
weight:60 kilograms
BMI= weight= 60 = 25.96
height2 2.31
Adult (age>18)
Category BMI range - kg/m2
Severe Thinness < 16
Moderate Thinness 16 – 17
Mild Thinness 17 - 18.5
Normal 18.5 – 25
Overweight 25 – 30
Obese Class I 30 – 35
Obese Class II 35 – 40
Obese Class III > 40
Children (age 2-18)
Category Percentile Range
Underweight <5%
Healthy weight 5% - 85%
At risk of overweight 85% - 95%
Overweight >95%
#include<iostream>
using namespace std;
int main()
{
float bmi,w,h; //w=weight , h=height
cout<<"Please Enter your weight in Pounds : ";
cin>>w;
cout<<"Please Enter your Height in Inches : ";
cin>>h;
bmi=(w*703)/(h*h);
cout<<"Your BMI is : "<<bmi<<endl;
if(bmi>25)
cout<<"Overweight";
else if(bmi<25 && bmi>18.5)
cout<<"Optimal";
else
cout<<"Underweight";
return 0;
}
Comments
Leave a comment