I have to add two array in a list. Say the list is n size from that
n size you have to add two array together.
Problem : a[] = {1,2,3,....120,.....,n};
a[] = {1,2,3,....120,.....,n};
__________________________________________________
public class AddArray {
public static void main( String[] args ) {
int a[] = {2,3,5,6,7,8,9}; // Could be n size going thru the list
int b[] = {5,7,2,9}; // also could be n size
for (int i=0; i< a.length; i++)
for (int j=0; J< j.length; j++)
System.out.println( a[i]+b[i]) + ", " };
}
____________________________________________________
This program works but it gives me more than what i need something
worong in my for loop. I need some help.
The output should be : 7, 10, 7, 15, 7, 8, 9