Question: Help me fix the problem with my code. import java.util.Scanner; public class Problem1 { public static int[] makeBigger(int[] arr, int n) { int[] newArr =

![class Problem1 { public static int[] makeBigger(int[] arr, int n) { int[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f31133ec44e_68366f311338732a.jpg)
Help me fix the problem with my code.
import java.util.Scanner;
public class Problem1 {
public static int[] makeBigger(int[] arr, int n) {
int[] newArr = new int[arr.length + n];
for (int i = 0; i
newArr[i] = arr[i];
System.out.print(newArr[i] + " ");
}
for (int j = arr.length; j
System.out.print(newArr[j] + " ");
}
return newArr;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] arr = new int[n];
for (int i = 0; i
arr[i] = sc.nextInt();
}
int x = sc.nextInt();
int[] result = makeBigger(arr, x);
System.out.print(result);
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
