Decode School

Decode School - The School for Problem Solvers

Welcome to my blog. Subscribe and get my latest blog post in your inbox.

Java Program to Meters to Kilo Meters

Get meter m from user and find kilometer km

Sample Input 1:

56000

Sample Output 1:

56

Program or Solution

					    
							
					    
					

Program Explanation

Get meter mts as input (using scanner class)

Calculate kilometer km by dividing meter mts by 1000.

(km=mts/1000, 1000 meter is equal to 1 kilometer)