Program 1: Write a Program in C for converting the value of meter into cm.
#include<stdio.h>
int main()
{
double meter = 40.8;
double centimeter;
centimeter = 100 * meter;
printf ("Value in Centimeter is: %.2f \n", centimeter);
return 0;
}
Output of Above C program:
Value in Centimeter is: 4080.00
Program 2: Write a Program in PHP for converting the value of meter into cm.
<?php
// This is a PHP program which converts the value of meter into the value of cm
$meter = 10;
$centimeter = 100 * $meter;
echo("Value of 10 meter in Centimeter is " . $centimeter . "\n");
?>
Output of Above PHP program:
Value of 10 meter in Centimeter is 1000
Program 3: Write a Program in Java for converting the value of meter into cm.
// This is a Java program which converts the value of meter into cm
import java.io.*;
class convert {
static double Conversion_meter_to_cm(int meter)
{
double centimeter;
centimeter = 100 * meter;
System.out.printf("Value in Centimeter is: %.2f \n", centimeter);
return 0;
}
public static void main(String args [])
{
int meter = 20;
Conversion_meter_to_cm(meter);
}
}
Output of Above Java program:
Value in Centimeter is: 2000.00
Program 4: Write a Program in Python for converting the value of meter into cm.
# This is a Python program which converts the value of meter into cm
meter=int(input("Enter the length in meter:"))
#convert meter to cm
centimeter = 100 * meter;
print("The length in centimetre is",round(centimeter,2))
Output of Above Python program:
Enter the length in meter: 25
The length in centimetre is 2500
Program 1: Write a Program in C for converting the value of meter into cm.
Output of Above C program:
Program 2: Write a Program in PHP for converting the value of meter into cm.
Output of Above PHP program:
Program 3: Write a Program in Java for converting the value of meter into cm.
Output of Above Java program:
Program 4: Write a Program in Python for converting the value of meter into cm.
Output of Above Python program: