Create a program that will convert the input inch(es) into its equivalent centimeters. One inch is equivalent to 2.54cms. Then display the result.
package inch;
import java.util.Scanner;
public class Inch {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter inches:");
double inc = scan.nextDouble();
System.out.printf("The equivalent value in inches is: %f", inc/ 2.54);
}
}
Comments
Leave a comment