I've tried a few ways now, but it seems whatever I put inside the if statement, doesn't get recognised when I try to run it. it either says symbol not found or 'n may not have been initialized '. Any advice please?
package en.codegym.task.pro.task05.task0505;
import java.util.Scanner;
/*
Reverse
*/
public class Solution {
public static void main(String[] args) {
//write your code here
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int n;
if(N>0){
n = N+1;
}
int[] array = new int[n];
array[0] = N;
for(int x = 1; x<=n; x++){
array[x] = sc.nextInt();
}
if((N%2)==0){
for(int i = (n-1); i>=0; i++){
System.out.println(array[i]);
}
}else{
for(int e = 0; e<n; e++){
System.out.println(array[e]);
}
}
}
}