Write a Java program to convert kilometers to meters centimeters and millimeters. As we know, 1 Kilometer = 100 Meters, 100000 Centimeters, and 1000000 Millimeters.
package Remaining; import java.util.Scanner; public class KMToMeterCmMM { private static Scanner sc; public static void main(String[] args) { sc= new Scanner(System.in); System.out.print("Please Enter the Kilometers = "); double kilometer = sc.nextDouble(); double meter = kilometer * 1000.0; double centimeter = kilometer * 100000.0; double millimeter = kilometer * 1000000.0; System.out.println("Distance in KiloMeters = " + kilometer); System.out.println("Distance in Meters = " + meter); System.out.println("Distance in CentiMeters = " + centimeter); System.out.println("Distance in MilliMeters = " + millimeter); } }