I have an array like this.
int p[] = new int[n];
which is actually like this.
//p[2,3,4,5,6];
Now I am multiplying each elemnt by 10 and want to store that value and letter wamt sum of that. my for loop.
int res ;
for(int i=0; i<n ;i++){
res = p[i]* 10;
}
Now my question is in second iteration result is loosing the previous hold value. how to fix that.