//Conversion of distance
import java.util.Scanner;
class Distance {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter distance between two cities in km:");
int d=sc.nextInt();
System.out.println("Distance in meters:"+(d*1000));
System.out.println("Distance in centimeters:"+(d*100000));
System.out.println("Distance in feets:"+(d*3280.84f));
System.out.println("Distance in inches:"+(d*39370.1f));
}
}
import java.util.Scanner;
class Distance {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter distance between two cities in km:");
int d=sc.nextInt();
System.out.println("Distance in meters:"+(d*1000));
System.out.println("Distance in centimeters:"+(d*100000));
System.out.println("Distance in feets:"+(d*3280.84f));
System.out.println("Distance in inches:"+(d*39370.1f));
}
}
No comments:
Post a Comment