You are passing the uninitialised variable
i
to specify the array sizes:
int i,j;
int arr[i];
int new_arr[i];
As a result, you don't know how large your arrays are actually. The compiler may initialise
i
with zero so that your arrays did not really exist and you will get random values from the stack when reading items out.
To avoid such mistakes you should set the compiler warning level to maximum and fix your code until you got no warnings.
[EDIT/UPDATE]
In your case I would define a size:
const int max_items = 5;
int arr[max_items];
int new_arr[max_items];
for (i = 0; i < max_items; i++)
[EDIT/UPDATE 2]
Once the above has been fixed, you should also reset
store
before the inner loop. Otherwise the value is cumulated over all five input values:
store = 0;
for(j=0;j<5;j++){