Why my code is not working, I use 2-D do approach to solve it kindly go through my code and resolve it
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int dp[n+1][2];
dp[1][0]=1;
dp[1][1]=1;
if(n==1)
cout<<dp[1][1]+dp[1][0]<<endl;
for(int i=2;i<=n;i++){
dp[i][0]=(dp[i-1][0]+dp[i-1][1]);
dp[i][1]=(dp[i-1][0]);
}
cout<<(dp[n][1]+dp[n][0])<<endl;
}
}