The Body Mass Index (BMI) a convenient rule of thumb used to broadly categorize a person as underweight, normal weight,
Posted: Sat May 14, 2022 3:32 pm
The Body Mass Index (BMI) a convenient rule of
thumb used to broadly categorize a person
as underweight, normal
weight, overweight,
or obese based on tissue mass (muscle, fat, and
bone) and height. It can be obtained with the following
formula:
BMI = weight / (height*height)
with the BMI in kg/m2 ,
the height in m and the mass
in kg.
Commonly accepted BMI ranges are:
Complete the following C program, which is
You can consider that the user will always
enter float values for the height and
weight values.
See the examples for the expected format of the
output.
Hint: The
function atof() declared in stdlib.h will
be useful.
For example:
code
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc != 3) {
printf("Usage: %s height weight\n",
argv[0]);
}
else {
// type your code here
}
return 0;
}
thumb used to broadly categorize a person
as underweight, normal
weight, overweight,
or obese based on tissue mass (muscle, fat, and
bone) and height. It can be obtained with the following
formula:
BMI = weight / (height*height)
with the BMI in kg/m2 ,
the height in m and the mass
in kg.
Commonly accepted BMI ranges are:
Complete the following C program, which is
You can consider that the user will always
enter float values for the height and
weight values.
See the examples for the expected format of the
output.
Hint: The
function atof() declared in stdlib.h will
be useful.
For example:
code
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
if (argc != 3) {
printf("Usage: %s height weight\n",
argv[0]);
}
else {
// type your code here
}
return 0;
}