Input the distance in metres and convert it into miles.
import
java.util.Scanner;
class
MeterToMile
{
public
static
void
main(String args[])
{
Scanner sc =
new
Scanner(System.in);
System.out.print(
"Enter the distance in meters : "
);
int
meter = sc.nextInt();
float
mile = meter/
1609
.34f;
System.out.println(meter+
" meters = "
+mile+
" miles"
);
}
}
No comments:
Post a Comment