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