Java Program to Convert Miles To Kilometers

Write a Java program to convert miles to kilometers. The formula to convert 1 Kilometer = 0.621371 Miles.

package Remaining;

import java.util.Scanner;

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

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

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.