How to Add Two Arrays In Java.
import java.util.Scanner;
public class arrays {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int num[] = new int [5];
int num2[] = new int [5];
int sum[] = new int [5];
System.out.println("Enter Integer for 1st Array");
for (int i= 0; i < 5;i++ )
{num[i]=input.nextInt();}
System.out.println("Enter Integer for 2nd Array");
for (int k=0;k<5;k++)
{num2[k]=input.nextInt(); }
System.out.println("Sum of both arrays is");
for (int s=0;s<5;s++)
{sum[s]=num[s]+num2[s];
System.out.println(sum[s]);
}
}}