34: Code: Highest number in array By AbhiJuly 16, 2018July 16, 2018Pseudocode let n=[1,2,6,4,5] var big = 0 for I in 0..4 { If n[i] > big { big=n [i] } } Share this:Click to share on Facebook (Opens in new window)Click to share on WhatsApp (Opens in new window)Like this:Like Loading... Related
4 thoughts on “34: Code: Highest number in array”
Good one. What would you change in your code if your array was {-1,-2,-6,-4,-5}
I just would say big=n[0]. Because for loop remains same.
That’s right. And you can start your loop at 1 too.
True.