how a loop turns to negative direction? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

how a loop turns to negative direction?

25th Sep 2016, 8:02 AM
sagir
sagir - avatar
5 Answers
+ 5
for example for (x=5;x>0;x--){ put your loop statement here } in the example above, the loop will run 5 times and variable x will decrease by 1 every loop.
26th Sep 2016, 10:02 AM
Mohammed Chetehouna
+ 2
Can you please specify exactly what do you want to do?
26th Sep 2016, 1:31 AM
Mohammed Chetehouna
+ 2
just that. Thanks
26th Sep 2016, 11:33 AM
sagir
sagir - avatar
0
I can turn the loop (-) direction
26th Sep 2016, 3:50 AM
sagir
sagir - avatar
0
you're welcome.
26th Sep 2016, 11:36 AM
Mohammed Chetehouna