Q:

Program to Convert Inches to Feet

belongs to collection: Miscellaneous Programs Examples

0

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

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

Feet = inches / 12

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 Inches into Feet.

// This is a C program which converts the value of Inches into the value of Feet   
#include<stdio.h>  
int main()   
{  
int inches = 40;  
double Feet;  
Feet = inches / 12;  
printf ("Value of 40 inches in Feet is: %.2f \n", Feet);   
return 0;  
}  

 

Output:

Value of 40 inches in Feet is: 3.33

 

Program 2: Write a Program in PHP for converting the value of Inches into Feet.

<?php   
// This is a PHP program which converts the value of Inches into the value of Feet   
$Inches = 10;   
Feet = inches / 12;   
echo("Value of 10 inches in Feet is " . $Feet . "\n");   
?> 1  

 

Output:

Value of 10 inches in Feet is: 0.83

 

Program 3: Write a Program in Java for converting the value of Inches into Feet.

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

 

Output:

Value in Feet is: 10.00

 

Program 4: Write a Program in Python for converting the value of Inches into Feet.

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

 

Output:

Enter the value of length in Inches: 240
The length in Feet 20.0

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 Kilometer to cm... >>
<< Program to Convert Inches to cm...