0
can anyone explain why the output is 6
I've been studying loops and am finding this topic very confusig.Please help me understand this output and if u can than plz do explain the other loops.Plz suggest other websites to clear up this topic. https://code.sololearn.com/W8997iTGrxM6/?ref=app
4 Antworten
0
In the last iteration when x becomes 5, then 5<6 is true and the while loop is executed so now after post increment your x becomes 6. Since 6<6 is false, it comes out of the loop and prints it.
0
am confused about the thing that in the beginning x has been declared a value of 0 and x < 6 why would it print value 6 and if it is a loop than why isn't the output 1 2 3 4 5 6 why 6 onlyy.Plz help