how to find sum of array elements using pointer in c