Addition of 2 arrays

coding is working fine on eclipse but showing problem in coding blocks compiler
import java.util.*;

public class Practise {
static Scanner scn = new Scanner(System.in);

public static void main(String[] args) {
	int size1 = scn.nextInt();
	int[] arr1 = new int[size1];
	if (size1 > 1 && size1 < 1000) {
		for (int i = 0; i < arr1.length; ++i) {
			arr1[i] = scn.nextInt();
		}
	}
	int size2 = scn.nextInt();
	int[] arr2 = new int[size2];
	if (size1 > 1 && size1 < 1000) {
		for (int i = 0; i < arr2.length; ++i) {
			arr2[i] = scn.nextInt();
		}
	}
	int arr3[] = addition2Array(arr1, arr2);
	for (int i = 0; i < arr3.length; ++i) {
		System.out.println(arr3[i]);
	}

}

public static int[] addition2Array(int[] arr1, int[] arr2) {
	int num2 = 0, num1 = 0;
	for (int i = arr1.length - 1; i >= 0; --i) {
		if (i >= 0) {
			num1 = arr1[i] + arr2[i + 1] + num2;
			if (num1 > 9) {
				num2 = num1 - (num1 - 1);
			} else {
				num2 = 0;
			}
			arr2[i + 1] = num1 % 10;
		} else {
			arr2[i] = arr2[i] + num2;
		}
	}
	return arr2;
}

}

@vinayaktrikha003,

Input:
5
5 4 3 2 1
5
9 8 7 6 5
Correct Output: 1, 5, 3, 0, 8, 6, END
Your Output: Run time error.

Also, use the correct output format.

https://ide.codingblocks.com/s/196631 corrected code. Please consider overflow of the sum of digits as well

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.