You are on page 1of 2

#include<iostream>

using namespace std;

int main()

// declare variable

float weight, height, bmi;

// input data

cout<<"Input your weight(kg) : "<<endl;

cin>>weight;

cout<<"Input your height(m) : "<<endl;

cin>>height;

//operation to do

bmi =weight/(height*height);

//if selection

if(bmi>=0 && bmi<18.5)

cout<<"Your BMI : "<<bmi<<" You are underweight"<<endl;

else if(bmi>=18.5 && bmi<=24.9)

cout<<"Your BMI : "<<bmi<<" You have Normal weight"<<endl;

else if(bmi>=25 && bmi<29.9)

cout<<"Your BMI : "<<bmi<<" You are Overweight"<<endl;

else if(bmi>=30 && bmi<=34.9)

{
cout<<"Your BMI : "<<bmi<<" You are Obesity 1"<<endl;

else if(bmi>=35 && bmi<39.9)

cout<<"Your BMI : "<<bmi<<" You are Obesity 2"<<endl;

else

cout<<"Your BMI : "<<bmi<<" You have extreme obesity"<<endl;

return 0;

You might also like