Count number of binary strings

febonacci relation is not working and also the count function as explained in the video

#include <bits/stdc++.h>
using namespace std;
int count(int n,int lastd){
if(n==1){
return 2;
}
if(lastd==0){
return count(n-1,0)+count(n-1,1);
}
if(lastd==1){
return count(n-1,0);
}
}
int dp1[1005];
int febo(int n){
if(n==1){
return 2;
}
if(n==2){
return 3;
}
if(dp1[n]!=0){
return dp1[n];
}
return dp1[n]=febo(n-1)+febo(n-2);
}
int main() {
int t,n;
int dp[105];
dp[0]=1;dp[1]=2;
for(int i=2;i<=105;i++){
dp[i]=dp[i-1]+dp[i-2];
}
cin>>t;
while(t–){
cin>>n;
memset(dp1,-1,sizeof(dp1));
//cout<<dp[n]<<endl;
cout<<febo(n)<<endl;
}
return 0;
}

Please save your code on https://ide.codingblocks.com/ and share the link

@riprogerdep Please use long long int everywhere

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.