BMI Calculator

 avatar
unknown
plain_text
a year ago
1.0 kB
2
Indexable
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/cFiles/main.c to edit this template
 */

/* 
 * File:   main.c
 * Author: xavierwhite
 *
 * Created on January 31, 2024, 9:35 AM
 */

#include <stdio.h>
#include <stdlib.h>

/*
 * 
 */
int main(int argc, char** argv) {
   
float weight;
float height;
float BMI;

printf("BMI values:\n");
printf("Underweight:less than 18.5:\nNormal:18.5 and 24.9\nOverweight:25 and 29.9\nObese:30 or greater\n");

printf("Enter weight in pounds:");
scanf("%f",&weight);

printf("Enter height in inches:");
scanf("%f",&height);

BMI = weight/(height * height) * 703;

printf("\n\n");
printf("BMI is:%f\n",BMI);

if(BMI<=18.5)
{
printf("you are Underweight\n");
}
else if((BMI>=19)&&(BMI<=24.9))
{
printf("you are normal weight\n");
}
else if((BMI>=25)&&(BMI<=29.9))
{
printf("you are overweight\n");
}
else if(BMI>=30)
{
printf("you are obese");
}
else
{
printf("you are not human");
}
return 0;
}
Editor is loading...