Hallo, brauche hilfe bei Schleifen kann es irgendwie nicht nachvollziehen:
Ausgabe:
Kann mir das bitte irgend jemand erklären, checks einfach nicht wie das Programm abläuft.;(
grüsse
Java:
int[] a = {0,1,2,3,4,5,6,7,8,9};
int x = 7;
int y = 8;
int z = 11;
System.out.println("los geht's !");
do
{
if(z > 9)
z--;
else
x++;
while(y < z)
{
y++;
System.out.println("y = " + y);
}
System.out.println("x = " + x);
}while(x < y);
System.out.println("z = " + z);
Java:
los geht's !
y = 9
y = 10
x = 7
x = 7
x = 8
x = 9
x = 10
z = 9
Kann mir das bitte irgend jemand erklären, checks einfach nicht wie das Programm abläuft.;(
grüsse