Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions assignment8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Emma Ladouceur

//This is most likely incorrect because I didn't really understand the memory leaks, but I looked up a bunch of stuff


1.
abcabc1
abc1
abc123

2.
I think it's 0 but i'm not sure


3.
NONE


4.

NO CHANGE
42 changes: 42 additions & 0 deletions inout.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//Emma Ladouceur

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(){
FILE *inFile = fopen("inout.txt", "r");


char inout[100];

float a;

fgets(inout, sizeof(inout), inFile);
int i;
float total, mean, sumsquare, std;
for(i = 0; i<=9; i++){

a = atof(inout);
printf("%f\n", a);
fgets(inout, 100, inFile);

total = total + a;

}
int numarr[9];

mean = total/9;
for(i=0; i<9;i++){

sumsquare = (total-mean)*(total-mean);

}
std = sqrt(sumsquare/i-1);

printf("The average is: %f\n", mean);
printf("The Standard Deviation is: %f", std);
fclose(inFile);
return 0;


}
9 changes: 9 additions & 0 deletions inout.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
8
7.83
3.55
3.78
9.34
5.75
8.23
6.66
6.89
Binary file added sort
Binary file not shown.
38 changes: 38 additions & 0 deletions sort.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//Emma Ladouceur
//Hmmm... still working on this, but i'm a little confused. I have a text book that I'm going to go through and try and work on this... but below is my sort.
//Homework

#include <stdio.h>

int main(){
int i, j,a,n,array[30];


printf("Enter a value for N \n");

scanf("%d", &n);



for(i=0; i<n; i++){

for(j=i+1; j<n; j++){
if(array[i] > array[j]){
a = array[i];
array[i]=array[j];
array[j]=a;


}

}

}
printf("The numbers are arranged in ascending order");
for(i=0;i<n;++i){

printf("%d\n", array[i]);
}


}