Addition Of Two Arrays

in Hindi - Addition Of Two Arrays



not yet

Source Code :

RUNimport java.util.Scanner;

public class AddArray
{
public static void main(String args[]){ 

int i;
int[] arr1= new int [10];
int[] arr2= new int [10];
int[] arr3= new int [10];

System.out.println("Enter 5 nos of 1st array\n");

for( i=0; i<5; i++){

Scanner enter = new Scanner(System.in);
arr1[i] = enter.nextInt();
}

System.out.println("Enter 5 nos of 2nd array\n");

for( i=0; i<5; i++){

Scanner enter = new Scanner(System.in);
arr2[i] = enter.nextInt();
}

for( i=0; i<5; i++){

arr3[i] = arr1[i] + arr2[i] ;
}

System.out.println("Addition of two arrays\n");

for( i=0; i<5; i++){

System.out.println(arr3[i]) ;
}

}
}