CSC300: Designing loops from scratch [15/21] Previous pageContentsNext page

Usually, we design a loop from scratch, rather than adapting a solution for 3 elements

Lets try it for max

Lets work with the following example:

new double { 21, 41, 31, 51, 11 }
                         ^

Suppose our loop has already looked at the first three numbers, and we are considering the fourth

Previous pageContentsNext page