+ 1
Can someone describe me, what is the output snd how this code works? Thanks Pls German but English is ok also.
int x = 7; int p = 0; while (p < 3) { System.out.print (x); } thanks for help :)
4 Antworten
+ 11
This is an infinite loop and it will print 7 forever, because p is always less than 3. Variable p is not incremented.
Das ist eine Schleife, die endlos läuft und immer 7 ausgibt, weil p immer kleiner als 3 bleibt. Die Variable p wird nicht hochgezählt.
+ 2
Thanks, Danke!
+ 1
It was really helpful :). I like this Q&A I learned here really much!
0
Hi! The output is 7777...
So it is an infinite loop, until var p is less than 3.