One way to determine how healthy a person is by measuring thebody fat of the person.
The formulas to determine the body fat for female and male are asfollows:
Body fat formula for women:
- A1 = Body Weight * 0.732 + 8.987
- A2 = Wrist Measurement At Fullest Point / 3.140
- A3 = Waist Measurement At Navel * 0.157
- A4 = Hip Measurement At Fullest Point * 0.249
- A5 = Forearm Measurement At Fullest Point * 0.434
- B = A1 + A2 - A3 - A4 + A5
- Body Fat = Body Weight - B
- Body Fat Percentage = Body Fat * 100 / Body Weight
Body fat formula for men:
- A1 = Body Weight * 1.082 + 94.42
- A2 = Waist Measurement At Fullest Point * 4.15
- B = A1 - A2
- Body Fat = body Weight - B;
- Body Fat Percentage = Body Fat * 100 / body Weight
In C program
Write a program that asks for the gender and the all the inputappropriate to the gender, then calculate and display the Body Fatand Body Fat Percentage.
Example (Numbers and symbols withunderscore indicate an input):
This program determines the body fat of a person.
Enter your gender (f|F|m|M): F
Enter body weight (in pounds): 120
Enter wrist measurement at fullest point (in inches): 5
Enter waist measurement at navel (in inches): 32
Enter hip measurement at fullest point (in inches): 36
Enter forearm measurement at fullest point (in inches): 23
Body fat: 25.586643
Body fat percentage: 21.322203
--------------------------------------------
This program determines the body fat of a person.
Enter your gender (f|F|m|M): m
Enter body weight (in pounds): 120
Enter waist measurement at fullest point (in inches): 5
Body fat: -83.510000
Body fat percentage: -69.591667