68 447
Assignments Done
Successfully Done
In December 2018

Answer to Question #62467 in C for tennyson

Question #62467
write a programe that uses an array to store the marks of 50 students in a class.The program should also calculate and output the sum and average of the marks.
Expert's answer
#include <stdio.h>

double Av(double *scores, size_t n, double * sum);

int main(void)


printf("Hello World!\n");

const size_t n = 50;

double a[n];

double sum = 0;

for(size_t i = 0; i< n; i++)

scanf("%lf", &a[i]);

printf("\nave = %lf ", Av(a, n, &sum));

printf("sum = %lf\n", sum);

return 0;


double Av(double *scores, size_t n, double *sum)


double ave = 0;

for(size_t i = 0; i < n; i++){

ave += scores[i];

*sum += scores[i];


ave = ave / (double)n;

return ave;


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions