What is happening with this? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is happening with this?

What is happening with this? He tells me complete the spaces in blank spaces to print from 1 to 15 on the screen. but if I put // while ($ i <= 15) { // echo $ i; // $ i ++; // what it prints will be up to 14 not until 15, because 15 is when it is conditioned false, the correct answer should be 16.

18th Feb 2019, 7:34 PM
Jeefry Nicolas Archila Romero
Jeefry Nicolas Archila Romero  - avatar
2 Answers
+ 10
It will be 15 because you check for less or equal 15 and increment after print.
18th Feb 2019, 8:00 PM
Hubert Dudek
Hubert Dudek - avatar
+ 1
Increment before printing, then it will work
18th Feb 2019, 8:07 PM
Maneren
Maneren - avatar