The Body Mass Index (BMI) is defined as ratio of the weight of a person(in kilograms) to the square of…