Why it give wrong answer? there is any problem in compiler

import java.util.*;
public class Main {
public static void main(String args[]) {

    Scanner kb=new Scanner(System.in);
	int t=kb.nextInt();
    while(t-->0)
	  {
		  int n=kb.nextInt();
		  int []zeroes=new int[n];
		  int []ones=new int[n];

          zeroes[0]=1;
		  ones[0]=1;

		  for(int i=1;i<n;i++)
		     {
				zeroes[i]=zeroes[i-1] + ones[i-1];
				ones[i]=zeroes[i-1];
			 }
	  System.out.println(zeroes[n-1]+ones[n-1]);
	  }

}

}

@abhishekg,

Use long instead of int.
https://ide.codingblocks.com/s/219562 Here is the corrected code.

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.