Quantcast
Channel: Cemetech
Viewing all articles
Browse latest Browse all 75370

General Programming :: RE: C++ Help with Calculating an Array Problem

$
0
0
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:

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


Viewing all articles
Browse latest Browse all 75370

Trending Articles