/* LALALALA LALA
I LIKE CHOCOLATE YOU DO TOO LALALALALALLALA */
#include <stdio.h>
main() {
int sumarrays( int *x, int *y, int c, int d );
int max1, max2;
/* Ask for the input numbers of the two arrays */
int input, d;
/* Get the maximum amount of spaces to put in the array ( First Array ) */
printf("Maximum size for the first array ( Integer only ) ? ");
scanf("%d", &max1);
int ArrayOne[max1];
/* Ask for the input numbers of the first array */
printf("1st array: ");
for ( d=0; d < max1; d++ ) {
printf(">> ");
scanf("%d", &input);
ArrayOne[d] = input;
}
/* Get the maximum amount of spaces to put in the array ( Second Array ) */
printf("Maximum size for the second array ( Integer only ) ? ");
scanf("%d", &max2);
int ArrayTwo[max2];
/* Ask for the input numbers of the second array */
printf("2nd array: ");
for ( d=0; d < max2; d++ ) {
printf(">> ");
scanf("%d", &input);
ArrayTwo[d] = input;
}
printf("%d\n", sumarrays(ArrayOne, ArrayTwo, max1, max2) );
return 0;
}
int sumarrays( int *x, int *y, int max1, int max2) {
int i, total=0;
for ( i = 0; i < max1; i++ )
total += *x++;
for ( i = 0; i < max2; i++ )
total += *y++;
return total;
}