Answer:
#include <stdio.h>
int p;
int g(int n)
{
static int minimum=101, maximum=-1, average=0;
if(n==0)
return -1;
else
{
printf("Enter course grade %d: ",p-n+1);
int grade;
scanf("%d",&grade);
g(n-1);
printf("%d\n",grade);
if(minimum>grade)
minimum=grade;
if(maximum<grade)
maximum=grade;
average=average+grade;
if(n==p)
{
printf("minimum= %d\n",minimum);
printf("maximum= %d\n",maximum);
printf("Average= %.2f\n",(double)average/(double)n);
}
return -1;
}
}
int main()
{
printf("Enter the number of grades:\n");
scanf("%d",&p);
g(p);
return 0;
}
Explanation: