Convert height in centimeters to feet and inches.

- Take input height in centimeters from the user.
- Convert it to feet and inches.
- Feet must be a whole number, but inches can be a fraction.

Examples:
- 1.5 inches = 0 feet 1.5 inches
- 14 inches = 1 foot 2 inches
- 35.9 inches = 2 feet 11.9 inches
- 36 inches = 3 feet 0 inches

Answer :

Final answer:

To convert height from centimeters to feet and inches, divide the height in centimeters by 2.54 to get the equivalent height in inches. Then, divide the inches by 12 to get the number of feet. The remainder after dividing the inches by 12 will give the number of remaining inches.

Explanation:

To convert height from centimeters to feet and inches, we can use the following steps:

  1. Divide the height in centimeters by 2.54 to get the equivalent height in inches.
  2. Divide the inches by 12 to get the number of feet.
  3. The remainder after dividing the inches by 12 will give the number of remaining inches.

Let's apply these steps to the given examples:

  • 1.5 inches = 0 feet 1.5 inches
  • 14 inches = 1 foot 2 inches
  • 35.9 inches = 2 feet 11.9 inches
  • 36 inches = 3 feet 0 inches

Learn more about converting height from cm to feet and inches here:

https://brainly.com/question/11188487

#SPJ11

Other Questions