Q:

Program to Convert Feet to Inches

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

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

Inches = 12 * 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 Inches.

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

 

Output:

Value in Inch is: 480.00

 

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

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

 

Output:

Value in Inch is: 120

 

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

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

 

Output:

Value in Inch is: 96.00

 

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

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

 

Output:

Enter the length in feet: 100
The length in Inches is 1200

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