Q:

Program to Convert Feet to millimeter

belongs to collection: Miscellaneous Programs Examples

0

Here, we will learn how to convert the length value, which is given in feet to the length in millimeter.

If we want to convert the value of feet into the millimeter value, then we have to use the following formula:

 

millimeter = 304.8 * feet.  

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program 1: Write a Program in C for converting the value of feet into millimeter.

#include<stdio.h>  
int main()   
{  
int feet = 98;  
double millimeter;  
millimeter = 304.8 * feet;  
printf ("Value in millimeter is: %.2f \n", millimeter);   
return 0;  
}  

 

Output of Above C program:

Value in millimeter is: 29870.40

 

Program 2: Write a Program in PHP for converting the value of feet into millimeter.

<?php   
// This is a PHP program which converts the value of feet into millimeter   
$feet = 10;   
$millimeter = 304.8 * $feet;   
echo("The value in millimeter is " . $millimeter . "\n");   
?>  

 

Output of PHP program:

The value in millimeter is 3048

 

Program 3: Write a Program in Java for converting the value given in feet into value in millimeter.

// This is a Java program which converts the value of feet into millimeter  
import java.io.*;   
class convert {   
static double Conversion_feet_to_millimeter(int feet)   
{   
double millimeter;  
millimeter  = 304.8 * feet;    
System.out.printf("Value in millimeter is: %.2f \n", millimeter);   
return 0;   
}    
public static void main(String args [])   
{   
int feet = 8;   
Conversion_feet_to_millimeter(feet);   
}  
}  

 

Output of above Java Program:

Value in millimeter is: 2438.40

 

Program 4: Write a Program in Python for converting the value of feet into millimeter.

# This is a Python program which converts the value of feet into millimeter  
  
feet=int(input("Enter the length in feet:"))   
#convert feet to millimeter  
millimeter  = 304.8 * feet;    
  
print("The length in millimeter",round(millimeter,2))  

 

Output of Above Python program:

Enter the length in feet: 1
The length in millimeter 304.8

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Miscellaneous Programs Examples

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Program to Convert Meter to Centimeter... >>
<< Program to Convert Feet to millimeter...