TheBulgarianWolf

Inches to Centimeters

Jan 14th, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner scanner = new Scanner(System.in);
  7.         System.out.print("Enter the length in inches: ");
  8.         double inches = scanner.nextDouble();
  9.         double centimeters = inches * 2.54;
  10.         System.out.println("The length in centimeters is: " + centimeters);
  11.  
  12.     }
  13. }
Add Comment
Please, Sign In to add comment