#include /* function prototypes */ void FindAve(int []); void main(void) { /* The simple program that finds the class average of 5 students who wrote a quiz using one dimensional array with a function. Also, print the result with input data in a table */ int mark[5]; /* The function FindAve is called to read all Marks and compute and print the average with the marks */ FindAve(mark); } /****** Function Definition begins ****/ void FindAve(int mark[]) { float average; int knt, sum = 0; for (knt = 0; knt < 5; knt++) { printf("type the %d mark \t:", knt); scanf("%d", &mark[knt]); sum += mark[knt]; } average = (float) sum/knt; /* This now prints the input data and result */ printf("Mark \n"); for (knt = 0; knt < 5; knt++) { printf("%d \n", mark[knt]); } printf("average = %0.2f \n", average); }