Here's my problem.
I need to add only the first and last elements of each row, and display them separately.
Ex.
Row 0=11
Row 1=11
Row 2=8
int arr[][]={{5,9,6},{3,2,8},{7,0,1}};
int sum=0;
for(int row=0;row<arr.length;row++){
for(int col=0;col<arr[row].length;col++)
sum=arr[row][col]+ arr[row][col];
System.out.println(sum+" ");
this is my code, and i think i just need some help. advanced thank you to whomever answers this.