Program 1: Write a Program in C for converting the value of mm into cm.
#include<stdio.h>
int main()
{
int mm = 400;
double centimeter;
centimeter = mm / 10;
printf ("Value in Centimeter is: %.2f \n", centimeter);
return 0;
}
Output of Above C program:
Value of 400 millimeter in Centimeter is: 40.00
Program 2: Write a Program in PHP for converting the value of mm into cm.
<?php
// This is a PHP program which converts the value of mm into cm
$mm = 10;
$centimeter = $mm / 10;
echo("Value in Centimeter is " . $centimeter . "\n");
?>
Output of Above PHP program:
Value of 10 millimeter in Centimeter is 1
Program 3: Write a Program in Java for converting the value of mm into cm.
// This is a Java program which converts the value of mm into cm
import java.io.*;
class convert {
static double Conversion_mm_to_cm(doube mm)
{
double centimeter;
centimeter = mm / 10;
System.out.printf("Value in Centimeter is: %.2f \n", centimeter);
return 0;
}
public static void main(String args [])
{
double mm = 2.5;
Conversion_mm_to_cm(mm);
}
}
Output of Above Java program:
Value in Centimeter is: 0.25
Program 4: Write a Program in Python for converting the value of mm into cm.
# This is a Python program which converts the value of mm into cm
mm=int(input("Enter the length in mm:"))
#convert mm to cm
centimeter = mm / 10;
print("The length in centimeter",round(centimeter,2))
Output of Above Python program:
Enter the length in mm:1500
The length in centimeter 150.0
Program 1: Write a Program in C for converting the value of mm into cm.
Output of Above C program:
Program 2: Write a Program in PHP for converting the value of mm into cm.
Output of Above PHP program:
Program 3: Write a Program in Java for converting the value of mm into cm.
Output of Above Java program:
Program 4: Write a Program in Python for converting the value of mm into cm.
Output of Above Python program: