Your scanf function is not properly implemented, because it doesn't stop on fifth input. Try this:
Code:
for (c = 0; c < n; c++){
scanf("%c%c", &array1[c], &array[c]);
getchar();
}
Note that getchar() eats blank spaces and new line.
You didn't initialize difference to any value, so you don't know it's value therefore result is unpredictive. Look at this examples:
Code:
int difference;
printf("%d", difference);
Result of this was 4198625, but we can't know for sure.
Code:
int difference=5;
printf("%d", difference);
Now the result was 5. So you should assign values to your variables. This was the reason why you were getting that weird number.
And why do you have so many variables for difference? Why don't you try with my previous advice? If it's not understandable I will explain it to you.