In this section, you will learn to convert Meters To Miles.
The following program helps you in converting Meters To Miles.
Code Description:
To convert Meters To Miles we have used a formula "meter = *
0.00062137119;". The compiler will ask to enter the number of Meters
from the keyboard due to the method "BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));".
Here we have taken meter to be of type Int. To avoid loss of precession
we have cast the output to be in double.
Here is the code of the program:
|
Output of the program:
| C:\unique>javac MetersToMiles.java C:\unique>java MetersToMiles Enter the Meters:1 Miles: 6.2137119E-4 C:\unique>java MetersToMiles Enter the Meters:4 Miles: 0.00248548476 C:\unique> |
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Convert Meters To Miles
Post your Comment