A program which inputs a
person’s height (in centimeters) and weight (in kilograms) and outputs one of
the messages: underweight, normal, or overweight, using the criteria:
Underweight: weight < height/2.5
Normal: height/2.5 <= weight <=
height/2.3
Overweight: height/2.3 < weight
Complied On : Code::Blocks 17.0
Save :- .c file (C Program)
Created By :- Lukas Yooma
Below is the code
#include <stdio.h>
#include <stdlib.h>
int main()
{
float height, weight;
printf("\nENTER YOUR HEIGHT IN CENTMETERS \n");
scanf("%lf",&height);
printf("\nENTER YOUR WEIGHT IN KILOGRAMMES \n");
scanf("%lf", &weight);
if(weight < height/2.5)
printf("YOU ARE UNDERWEIGHT \n");
else
if(height/2.3 < weight)
printf("YOU ARE OVERWEIGHT \n");
else
if(height/2.5 <= weight <= height/2.3)
printf("YOU ARE NORMAL\n");
main(0);
}
Thanks for reading leave a comment for any queries