#include <stdio.h> int max(int a[], int n); /*propotype declaration*/ main() { int a1[10] = {29,102,83,281,123,145,189,839,149,20}; int maxvalue, i; maxvalue = max(a1,10); for (i = 0; i <= 10; i++) printf("%4d",a1[i]); printf("\n"); printf("the max value is: %d\n",maxvalue); } /*--------------function max, find the max value-------------*/ int max(int b[], int n) { int maxvalue = b[0], i; for(i = 1; i < n; i++) { if(maxvalue < b[i]) maxvalue = b[i]; } return maxvalue; }