You are on page 1of 1

//programmer: faiz-faizal

#include <iostream>
using namespace std;
int main()
{
float weight, height;
int bmi;
cout <<"------------------------" << endl;
cout <<" BMI ( Body Mass Index )" << endl;
cout <<"------------------------" << endl;
cout <<"Underweight Less than 18.5" << endl;
cout <<"Normal
Less than 18.5 - 25" << endl;
cout <<"Overweight
Less than 25 - 30" << endl;
cout <<"Obese
Greater than 30\n" << endl;
cout << ">>> Enter your weight,(kg): " ;
cin >> weight;
cout << ">>> Enter your height,(m): " ;
cin >> height;
bmi = (weight / ( height * height) );
if ( bmi < 18.5 )
{
cout << ">>> Your BMI is " << bmi << endl;
cout << ">>> Your weight categories is: Underweight\n" << endl;
}
else if ( bmi < 25)
{
cout << ">>> Your BMI is " << bmi << endl;
cout << ">>> Your weight categories is: Normal\n" << endl;
}
else if ( bmi < 30 )
{
cout << ">>> Your BMI is " << bmi << endl;
cout << ">>> Your weight categories is: Overweight\n" << endl;
}
else
{
cout << ">>> BMI is " << bmi << endl;
cout << ">>> Thus, your weight categories is: Obese\n" << endl;
}
system ("pause");
return 0;
}

You might also like