Q:

Program to Convert Feet to m

belongs to collection: Miscellaneous Programs Examples

0

In this article, we will learn how to convert the length value, which is given in feet to the length in meter.

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

 

meter = feet /3.281

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 meter.

#include<stdio.h>  
int main()   
{  
int feet = 40;  
double meter;  
meter = feet / 3.281;  
printf ("The Value of 40 feet in meter is: %.3f \n", meter);   
return 0;  
}  

 

Output:

The value of 40 feet in meter is: 12.192

 

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

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

 

Output:

The value of 100 feet in meter is: 30.47

 

Program 3: Write a Program in Java for converting the value of feet into meter.

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

 

Output:

Value of given feet in meter is: 0.762

 

Program 4: Write

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

 

Output:

Enter the length in feet: 55
The length in meter is 16.76

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 Inches to meter... >>
<< Program to Convert millimeter to Feet...