Hallo,
Nach eingabe von 1 und 2 hat man das Ergebnis 0,1, was offensichtlich falsch ist.
Nach Eingabe von 2 und 4 hat man das Ergebnis 0,2.
Kann mir jmd helfen ?
Vielen Dank
lalupiz
import java.util.Scanner;
public class BMI {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Bitte geben Sie zwei ganze Zahlen ein. Dabei wird die erste durch die zweiter Zahl geteilt.");
int zahl1 = sc.nextInt();
int zahl2 = sc.nextInt();
System.out.println("Der Quotient beträgt: "+ zahl1/zahl2+","+zahl1%zahl2);
}
}
Nach eingabe von 1 und 2 hat man das Ergebnis 0,1, was offensichtlich falsch ist.
Nach Eingabe von 2 und 4 hat man das Ergebnis 0,2.
Kann mir jmd helfen ?
Vielen Dank
lalupiz
import java.util.Scanner;
public class BMI {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Bitte geben Sie zwei ganze Zahlen ein. Dabei wird die erste durch die zweiter Zahl geteilt.");
int zahl1 = sc.nextInt();
int zahl2 = sc.nextInt();
System.out.println("Der Quotient beträgt: "+ zahl1/zahl2+","+zahl1%zahl2);
}
}