User:Bronkid23


 * 1) include 
 * 2) include 
 * 3) include 
 * 4) define NUM_COL 3
 * 5) define NUM_ROW 10

void header(void); char again(void); void findmean(int[][NUM_COL]); void findmax(int[][NUM_COL]);

int main {		char doagain='y'; while (toupper(doagain) == 'Y') {       int thearray[NUM_ROW][NUM_COL];

header; int i,j,mean; int a;		FILE *infpt; char filename[30]; printf("enter the name of the file: "); fflush(stdin); scanf(" %s",filename); infpt=fopen(filename,"r"); if (infpt == 0) { 			printf("that's not a file. Try again please: "); doagain='y'; continue; }

for (i=0;i<NUM_COL;i++) //read in data {			for (j=0;j=mean2) { 			printf("the second column is larger than the third\n"); printf("the vaule is %d\n",mean1); }		else {			printf("the third column is larger than the second\n"); printf("the value is %d\n",mean2); }		return; }

void findmax(int b[][NUM_COL]) {	int max=0,m,n,max_pos=0; for (m=0;mmax) {			max=b[m][1]; max_pos=m+1; }	}	printf("the max of colum 2 is %d\tthe position is: [%d][2]",max,max_pos); }

char again(void) {       char doagain; do       { printf("would you like to run the program again(y/n)?\n\n"); fflush(stdin); scanf("%c",&doagain); }       while (toupper(doagain) != 'Y' && toupper(doagain) != 'N'); return(doagain); }