write a program in java to convert distance of 5 kilometre into metres and inches and feet
Answers
Answered by
3
Answer:
import java.io.*;
class GFG
{
public static void main (String[] args)
{
double cm, meter, kilometer;
cm = 1000;
// Converting centimeter
// into meter and kilometer
meter = cm / 100.0;
kilometer = cm / 100000.0;
System.out.println("Length in meter = " +
meter + "m");
System.out.println("Length in Kilometer = " +
kilometer + "km");
}
}
input: Length in centimeter =6540
Output:
Length in meter = 65.4 m
Length in kilometer = 0.0654 km
( i wrote for km and metre ) see this example and try for inches and feet by yourself
Similar questions
Social Sciences,
5 months ago
English,
5 months ago
Biology,
11 months ago
Geography,
11 months ago
Social Sciences,
1 year ago
Math,
1 year ago