Task

Create a function that returns the maximum value in a provided set of values,

where the number of values may not be known until run-time.




$ awk 'func max(a){for(i in a)if(a[i]>r)r=a[i];return r}BEGIN{a[0]=42;a[1]=33;a[2]=21;print max(a)}'
42