Count Number of binary strings

#include
using namespace std;
int countstring(int n)
{
int arr[2][100];
arr[0][0]=1;
arr[1][0]=1;
for(int i=1;i<91;i++)
{
for(int j=0;j<2;j++)
{
if(j==0)
arr[j][i]=arr[j][i-1]+arr[j+1][i-1];
if(j==1)
arr[j][i]=arr[j-1][i-1];

	}
}
return arr[0][n];

}
int main() {
int t;
cin>>t;
while(t–)
{
int n;
cin>>n;
cout<<countstring(n)<<endl;
}
return 0;
}

@mvikas545
you have to use long long, since this values becomes very large.

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.