BMI calculator program in c programming

Table of contents

No heading

No headings in the article.

#include /**

  • main - Programme to build BMI calcutor to find a patient BMI
  • Description: a programm to print BMI of a patient
  • Return: 0 */ int main() { float height, weight, BMI;

    printf("Enter patient height: \n"); scanf("%f", &height);

    printf("Enter patient weight: \n"); scanf("%f", &weight);

    BMI = weight / (height * height);

    printf("Your Body Mass Index is %f\n", BMI);

    if (BMI < 18) printf("Underweight\n");

    else if (BMI >= 18 && BMI <= 25) printf("Normal weight\n");

    else if (BMI >= 26 && BMI <= 29) printf("Overweight\n");

    else printf("Obesity\n");

    return 0; }