0

for Glitches

Whenever I add anything in a for loop, It keeps saying: "No output.", help me please. https://sololearn.com/compiler-playground/cMr9RoEQavG0/?ref=app

1st Oct 2024, 8:23 PM
StarCodes
2 odpowiedzi
+ 4
The middle term needs a 'while true' condition. The loop will run while this condition is true. It will stop when this is false. i == 5 is false from the start, where i=1. That's why your loop will not run
1st Oct 2024, 11:33 PM
Bob_Li
Bob_Li - avatar
+ 3
Change i == 5 to i <= 5, then you will get an output.
1st Oct 2024, 8:38 PM
Jan
Jan - avatar