I declared the array before the for loop and now I want to concatenate the result of my for loop into the array. The following doesn't work and gives me error as "error: cannot find symbol".
My code is
for(int j=i; j<=arr.length-1; j++){
// checking for condition
if (i<j )
{
int temp = arr[i]+arr[j];
if (temp%sum==0) {
System.out.println("Pair with given sum " +
sum + " is (" +temp+")");
result[] += temp;
}
}