Untitled
unknown
plain_text
2 years ago
688 B
16
Indexable
import java.util.Scanner;
public class cmtoinch {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter value in centimeters: ");
double centimeter = sc.nextDouble();
double inch = centimeter / 2.54;
System.out.println(centimeter + " centimeters is " + inch + " inches");
System.out.println("Enter value in meters: ");
double meters = sc.nextDouble();
double kilometer = meters/1000;
System.out.println(meters + " meters is " + kilometer + " kilometers");
}
}
Editor is loading...
Leave a Comment