将英寸转换为厘米的程序

5 Sept 2024 | 2 分钟阅读

在这里,我们将学习如何将以英寸为单位的长度值转换为以厘米为单位的长度。

如果我们想将英寸的值转换为厘米值,则必须使用以下公式:

厘米 = 2.54 * 英寸。

程序 1:编写一个 C 语言程序,将英寸值转换为厘米。

输出

Value in Centimeter is: 101.6

程序 2:编写一个 PHP 程序,将英寸值转换为厘米。

输出

Value of 10 inches in Centimeter is: 25.4

程序 3:编写一个 Java 程序,将英寸值转换为厘米。

输出

Value in Centimeter is: 50.8 

程序 4:编写一个 Python 程序,将英寸值转换为厘米。

输出

Enter the length in Inches: 24
The length in centimeter 60.96