Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Es gibt verschieden Schleifentypen:

For-Schleife

for([Variablen Init.],[Bedingung],[Fortsetzung]) {
}

Code Block
for(int i=0; i <= 100; i++)
{
   println(i);
}

While-Schleife

while([Bedingung]) {
}

Code Block
int x=0;
while(x <= 100)
{
   println(x);
   x++;
}

Do-While-Schleife

do{
} while([Bedingung]);

Code Block
int x=0;
do
{
   println(x);
   x++;
}while(x <= 100);

Aufgabe

Erstelle ein Programm welches einen Wald auf den Bildschirm zeichnet

...