Author: souvik1997
Posted: 08 Dec 2012 04:32:44 pm (GMT -5)
Well, you do actually need the whole program to see what it's doing. Without the loop, you won't know which elements of the array it's actually checking (e.g. is it checking every other element?). If I were to write it out, I would do so like this:
Code:
_________________
CALCnet Tournament-38%
![]()
![]()
deviantArt
![]()
Posted: 08 Dec 2012 04:32:44 pm (GMT -5)
Well, you do actually need the whole program to see what it's doing. Without the loop, you won't know which elements of the array it's actually checking (e.g. is it checking every other element?). If I were to write it out, I would do so like this:
Code:
la is 2 at first.
if (6 > 2)
la is 6
if (5 > 6)
5 isn't greater than 6, so nothing happens
if (7 > 6)
la is 7
if (9> 7)
la is 9
print la
_________________
CALCnet Tournament-38%


deviantArt
