logo

Crowdly

The objective is to compute the statistics of Test-2 of Coding Cafe - in terms o...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

The objective is to compute the statistics of Test-2 of Coding Cafe - in terms of the highest score, lowest score and the average score. Please study the following main() function, which calls another function called getStats() in line 11:

  1 #include <stdio.h>

  2 #define MAX 186

  3 

  4 int main()

  5 {

  6   float test1[MAX];

  7   float highest,lowest,average;

  8   for (i=0; i<MAX; ++i)

  9     scanf("%d", &test1[i]);

 10 

 11   getStats(test1, &highest, &lowest, &average);

 12   printf("%f %f %f\n", highest, lowest, average);

 13 

 14   return 0;

 15 }                                                                     

(a) Write the function declaration (prototype) of getStats() function. No need to write the body of the function.

(b) Instead of the current version of line 11, suppose the function was invoked by writing

getStats(test1, highest, lowest, average); 
would it make any difference to the way the program works? Explain your answer.

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на dle.plaksha.edu.in?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!