Code:
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
//declare variables
float weight = 0;
float height = 0;
float BMI = 0;
//enter height and weight
cout << "Height? ";
cin >> height;
cout << "Weight? ";
cin >> weight;
//calculate BMI
BMI = 703*weight/(height*height);
cout << "Your BMI is " << BMI << endl;
if (BMI <= 18.5 )
{
cout<<"You are underweight\n";
}
else
{ //1
if (BMI > 19 && BMI <=24)
{
cout<<"Your weight is normal\n";
}
else
{ //2
if (BMI > 25 && BMI <=29)
{
cout<<"You are overweight\n";
}
else
{ //3
if (BMI => 30)
{
cout<<"You are obese\n";
}
} //end of 4
} // end of 3
} // end of 2
} //end of 1
// end of else
system("pause");
return 0;
} //end of main function

