Java Program to Convert Kilometers To Miles

Write a Java program to convert kilometers to miles. The formula to convert 1 Mile = 1.6093434 Kilometers.

package Remaining;

import java.util.Scanner;

public class KMToMile {
	private static Scanner sc;
	public static void main(String[] args) {
		sc= new Scanner(;

		System.out.print("Please Enter the Kilometers =  ");
		double kilometer = sc.nextDouble();
		double mile = kilometer * 0.621371;
		System.out.println("Distance in KiloMeters = " + kilometer + " KiloMeters");
		System.out.println("Distance in Miles      = " + mile + " Miles");
Java Program to Convert Kilometers To Miles

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.