int main(int argc, char **argv) { srand(time(NULL)); int array1[10], array2[10]; int i; for(i = 0; i < 10; i++) { array1[i] = (rand() % 100) + 1; array2[i] = (rand() % 100) + 1; } int * array3 = addarrays(array1, array2, 10); printf("The sum of every number in both arrays is %d.\n", sumarrays(array1, array2, 10)); printf("The sum of each parallel element in the arrays is"); for(i = 0; i < 10; i++) { printf(" %d", array3[i]); } printf("\n"); return 0; }
int main(void) { printf("The total of array one is %d and total of array two is %d\n", sumarrays(first, MAX1), sumarrays(second, MAX2)); return 0; }
int main(void) { total = sumarrays(array1, MAX1, array2, MAX2); printf("The total is %d\n", total); return 0; }
int main(void){ // call the sumarrays function and pass it the 2 arrays and their length, store returned value in total variable total = sumarrays(array1, MAX1, array2, MAX2); // print total printf("The total is %d\n", total); return 0; }