Computer Science, asked by lavisharma123456, 6 months ago

Write a program to Create a class height with a method void change height ( int height) containing height of a student in inches as the argument. convert the height into feet and inches and print the height along with the converted height in feet and inches ( where 1 feet = 12 inches)​

Answers

Answered by allinonehansika
1

Answer:

Program to convert Centimeter to Feet and Inches

In this article, we will learn how to convert Height, given in centimeter to Height in feet and inches.

Examples:

Input : centimeter = 10

Output : inches = 3.94

feet = 0.33

Input : centimeter = 85

Output : inches = 33.46

feet = 2.79

Recommended: Please try your approach on {IDE} first, before moving on to the solution.

We know that 1 inch is equal to 2.54 centimeter, so 1 centimeter is equal to 0.3937 inches. Therefore, n centimeters are equal to (n * 0.3937)inches.

Similar questions