Just a little work I've done so far (added code tags)...

Code:

#include <stdio.h>
#include <stdlib.h>
const int n=30;
struct custInfo {
int custId;
int rating;
}
int main(void)
{
FILE *ifp, *ofp;
struct custInfo month_info[n];
int i, arith_mean, harm_mean, median, mode;
float arithmeticMean(struct custInfo arr[], int size);
float harmonicMean(struct custInfo arr[], int size);
if ((ifp=fopen("survey.dat", "r"))==NULL) {
fprintf(stderr, "Can't open survey.dat for input.\n");
return 1;
}
if ((ifp=fopen("results.dat", "w"))==NULL) {
fprintf(stderr, "Can't open results.dat for output.\n");
return 2;
}
for (i=0; i<n; i++)
fscanf(ifp, "%d %d", &month_info[i].custId, &month_info[i].rating);
arith_mean=arithmeticMean(month_info, n);
harm_mean=harmonicMean(month_info, n);
fclose(ifp);
fclose(ofp);
return 0;
}
float arithmeticMean(struct custInfo arr[], int size)
{
int i, average, sum;
for(i=0; i<n; i++)
sum=sum+arr[i];
average=sum/n;
return average;
}
float harmonicMean(struct custInfo arr[], int size)
{
int i, denom, harmonicMean;
for(i=0; i<n; i++)
denom=denom+(1/arr[i]);
harmonicMean=n/denom;
return harmonicMean;
}
void idSort(struct custInfo arr[], int n)
{
struct custInfo temp;
int i, j, minIndex;
for(i=0; i<n; i++) {
minIndex=i;
for(j=i+1; j<n; j++)
if(arr[j].custId<arr[minIndex].custId)
minIndex=j;
temp=arr[minIndex];
arr[minIndex]=arr[i];
arr[i]=temp;
}
}
void ratingSort(struct custInfo arr[], int n)
{
struct custInfo temp;
int i, j, minIndex;
for(i=0; i<n; i++) {
minIndex=i;
for(j=i+1; j<n; j++)
if(arr[j].rating<arr[minIndex].rating)
minIndex=j;
temp=arr[minIndex];
arr[minIndex]=arr[i];
arr[i]=temp;
}
}