Computer Science, asked by premachandramr1977, 11 months ago

write a program in java to convert distance of 5 kilometre into metres and inches and feet ​

Answers

Answered by nehar1306
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