define total = 0define array[n] = {n1, n2, n3, n4, ...}for 0 to n - 1 total = total + array[n]print 'Average: 'print total / nend