Relative efficiency of n tasks in 1 loop vs. 1 task each in n loops?
Collecting the information in a single iteration would be way better, but you'll only notice the difference if your array contains a large number of numbers. On a small scale, it just won't make a difference.