Home Segments Top Top Previous Next

401: Practice

Write a program that displays a complete sentence that indicates the deviation from the person's ideal weight, truncated to the nearest integer. Your program's input is three numbers: weight in kilograms, height in meters, and a gender code. Be sure that, if the deviation is just 1 kilogram, the word kilogram appears, rather than kilograms.