42
public static void main (String[] args) {
int kilometres;
double litres, kpl;
Scanner scan = new Scanner (System.in);
System.out.print ("Enter the number of
kilometres: ");
kilometres = scan.nextInt();
System.out.print ("Enter the litres of fuel
used: ");
litres = scan.nextDouble();
kpl = kilometres/litres;
System.out.println ("Kilometres Per litr: " +
kpl);
}
}
Достарыңызбен бөлісу: