/* Problem 3 practice Write a function int difference (int A[], int B[],int size ) that finds and returns the amount of differences between two arrays. For example: A: 1, 2, 5, 3, 2, 7, -9, 10, 2, 3 B: 1, 2, 5, 4, 2, 7, 5, 10, 2, 3 the amount of differences will be 2,since A[3] is not equal to B[3] and A[6] is not equal to B[6]. If A and B are identical the amount of differences will be 0. Write a program that reads 4 integer arrays of 10 elements each and for each pair finds the amount of differences using the function that you wrote. */ #include #include #include #define SIZE 10 //function prototypes int difference(int A[], int B[],int size); void make_random_array(int A[], int size, int min, int max); void print_array(int A[], int size); int main(){ srand(time(NULL)); int i, A[SIZE],B[SIZE]; for(i=0; i<2;i++){ make_random_array(A,10, -1,1); make_random_array(B,10,-1,1); printf("array A\n"); print_array(A,10); printf("array B\n"); print_array(B,10); printf("the number of differences is %d\n",difference(A,B,10)); } } void make_random_array(int A[], int size, int min, int max){ int i; for(i=0;i