Home » Program to Convert cm to Feet and Inches

Program to Convert cm to Feet and Inches

by Online Tutorials Library

Program to Convert cm to Feet and Inches

Here, we will learn how to convert the length, which is given in centimeter, to the length in feet and inches.

Following are the two formulas which help to convert cm to feet and inches:

  1. 1 inch = 2.54 centimeter
  2. 1 feet = 30.48 centimeter

From these formulae, we find the following two formulas:

  1. inch = 0.3937 * Centimeter (cm)
  2. feet = 0.0328 * Centimeter (cm)

Program 1: Write a Program in C for converting the cm to feet and inches.

Output:

Inches is: 15.75   Feet is: 1.31  

Program 2: Write a Program in PHP for converting the cm to feet and inches.

Output:

Inches is: 3.94   Feet is: 0.33  

Program 3: Write a Program in Java for converting cm to feet and inches.

Output:

Inches is: 7.87  Feet is: 0.656  

Program 4: Write a Program in Python for converting cm to feet and inches.

Output:

Enter the height in centimeters: 167  The length in feet 5.48  The length in inches 65.8  

You may also like