#include #include #define MAX 1000 void readdata ( int A[], int n ) { int i; for (i=0; i max) max = A[i]; printf("Maximum = %d\n", max); } int main () { int n, A[MAX]; char resp; printf("Enter n : "); scanf("%d", &n); readdata(A,n); do scanf("%c",&resp); while (resp != '\n'); printf("What to compute (a/m/M) ? "); scanf("%c", &resp); if (resp == 'a') average(A,n); else if (resp == 'm') minimum(A,n); else if (resp == 'M') maximum(A,n); else printf("Unrecognized command...\n"); exit(0); }