FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 117   



Following program shows you how to convert millimeters into centimeters.
In this program we get millimeters from user, once we get those we need to divide with 10 so that we get in centimeters

import java.util.Scanner;

public class MathUnitConversions3 {

    public static void main(String[] args) {

        double millimeters;

        Scanner in = new Scanner(System.in);

        System.out.println("Please enter millimeters:");
        millimeters = in.nextInt();

        double centimeters = millimeters / 10;
        System.out.println(centimeters + " Centimeters");

    }

}

Output:

Please enter millimeters:
25
2.5 Centimeters



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News