All pastes #813095 Raw Edit

Lab F

public c v1 · immutable
·published 2007-12-12 07:26 UTC
rendered paste body
/* Put Your Heading Here!!!*/#include <stdio.h> /*You may need more than this!*/int sort(int response[99]);float mean(int response[99]);int main(){int response[99] = {6, 7, 8, 9, 8, 7, 8, 9, 8, 9, 7, 8, 9, 5, 9, 8, 7, 8, 7, 8, 6, 7, 8, 9, 3, 9, 8, 7, 8, 7, 7, 8, 9, 8, 9, 8, 9, 7, 8, 9, 6, 7, 8, 7, 8, 7, 9, 8, 9, 2, 7, 8, 9, 8, 9, 8, 9, 7, 5, 3, 5, 6, 7, 2, 5, 3, 9, 4, 6, 4, 7, 8, 9, 6, 8, 7, 8, 9, 7, 8, 7, 4, 4, 2, 5, 3, 8, 7, 5, 6, 4, 5, 6, 1, 6, 5, 7, 8, 7}, i;sort(response);printf("Responses in ascending order\n");for (i = 0; i <= 98; i++)     printf("%3d ", response[i]);printf("\n\n%d", response[50]);mean(response);	/*Start with Psuedocode here*/	return 0;}int sort(int response[99]){	int i, temp, pass;		for(pass = 1; pass < 99; pass++)				for(i = 0; i < 98; i++)						if (response[i] > response[i+1])				{					temp = response[i];					response[i] = response[i+1];					response[i+1] = temp;				}					return(response[99]);}float mean(int response[99]){int total, i; int mean;for(i=0; i<=98; i++)	total+=response[i];mean=total/99;printf("\n%f", total);}