Program to calculate inch to meters:
import java.util.Scanner;
public class InchestoMeter {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
double inch;
double meter;
System.out.println("Enter a value for inch: ");
inch = sc.nextDouble();
meter = inch * 0.0254;
System.out.println(inch + " inch = " + meter + " meters");
}
}
Above program shows the following output:Enter a value for inch: 2000
2000.0 inch = 50.8 meters
NEXT: Calculate Foot to Cm
No comments:
Post a Comment
If you have any doubts, please discuss here...👇