+ 2
Hey guys, who can help me?
How can this code outputs 6. Who can explain? https://code.sololearn.com/WiBxfi5021zW/?ref=app
13 Respostas
+ 1
не знаю как на английском написать, но там обратите же внимание там х с нуля начинается, то есть когда он заходит в цикл первоначальное значение х=0 и когда он видит х=0 он увеличивает значение на 1. то есть при х=0, значение 1, тогда при х=5 значение будет уже 6.
+ 6
x = 6 and then conditon is false and outputs 6
+ 3
The last iteration of the while loop increases the value of x from 5 to 6 then the comparison is made x < 6 where x is 6 (6 < 6) this is false so the loop ends and the current value of x (6) is output to the screen.
+ 3
The condition is tested when x = 5, x is then increased by one and then printed.
+ 1
didnt get it
+ 1
can you explain "по-подробней"))
+ 1
ChaoticDawg, man thank you very much
+ 1
thanks guys
+ 1
hey friend when the condition that is x<6 is used it comes till x=5 that is true for your condition so it will print its increment value 6 and the condition will break from there i think i could hrlp you
+ 1
yes Aditya, you also were a great to help me
+ 1
thnks😊😊😊
0
спасиюо Рашид, за подробный ответ)