Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int size, i, sum = 0, *height;
printf("How many students are in the class?");
scanf("%d", &size);
height = malloc(size * sizeof(int));
for (i = 0; i < size; ++i)
{
printf("\nEnter Height of Student %d:", i + 1);
scanf("%d", &height[i]);
sum += height[i];
}
puts("\nBelow are the entered numbers");
for(i = 0; i < size; ++i)
{
printf("%d\t", height[i]);
}
puts("\nBelow is the height statistics of the class\n");
puts("Height\tnumber of pupils");
/*
Implement statistics here
*/
printf("Average %f\n", (float) sum / size);
free(height);
return 0;
}