Java program to convert inches to feet
Following program shows you how to convert inches to feet.
In this program we get inches from user, once we get those we need to divide with 12 so that we get in feet
import java.util.Scanner;
public class MathUnitConversions5 {
public static void main(String[] args) {
Double inches;
Scanner in = new Scanner(System.in);
System.out.println("Please enter inches:");
inches = in.nextDouble();
double feet = inches / 12;
System.out.println(feet + " Feet");
}
}
Output:
Please enter inches:
13
1.0833333333333333 Feet