luc022.c (1693B)
1 /* 2 * Author : Amit Dutta <amitdutta4255@gmail.com> 3 * Date : 12 Dec 2025 4 * Repo : https://github.com/notamitgamer/bsc 5 * License : MIT License (See the LICENSE file for details) 6 */ 7 8 /* The Body Mass Index (BMI) is defined as ratio of weight of the 9 person (in Kilograms) to square of the height (in meters). 10 Write a program that receives weight and height, calculate the BMI, and reports 11 the BMI catagory as per the following table. 12 BMI Catagory BMI 13 Starvation < 15 14 Anorexic 15.1 to 17.5 15 Underweight 17.6 to 18.5 16 Ideal 18.6 to 24.9 17 Overweight 25 to 25.9 18 Obese 30 to 39.9 19 Morbidly Obese >= 40 20 */ 21 /* Let Us C, Chap- 4, Page - 72, Qn No.: D(d) */ 22 23 #include <stdio.h> 24 25 int main() 26 { 27 double weight, height, bmi; 28 printf("Enter your Weight (in Kilograms) and Height (in Meters) : "); 29 scanf("%lf %lf", &weight, &height); 30 bmi = weight / (height * height); 31 printf("\nCalculated BMI : %g", bmi); 32 if (bmi < 15) 33 printf("\nBMI Catagory : Starvation"); 34 else if (bmi >= 15.1 && bmi <= 17.5) 35 printf("\nBMI Catagory : Anorexic"); 36 else if (bmi >= 17.6 && bmi <= 18.5) 37 printf("\nBMI Catagory : Underweight"); 38 else if (bmi >= 18.6 && bmi <= 24.9) 39 printf("\nBMI Catagory : Ideal"); 40 else if (bmi >= 25 && bmi <= 25.9) 41 printf("\nBMI Catagory : Overweight"); 42 else if (bmi >= 30 && bmi <= 39.9) 43 printf("\nBMI Catagory : Obese"); 44 else if (bmi >= 40) 45 printf("\nBMI Catagory : Morbidly Obese"); 46 else 47 printf("\nBMI Catagory : Unclassified"); 48 return 0; 49 }