not able to correctly do the code ,may be have some logical problem help me to fix
//friend’s paring problem
#include<bits/stdc++.h>
using namespace std;
int NoOfWays(int n,int dp[])
{
int ans;
//base case
dp[0]=0,dp[1]=1;
for(int i=2;i<=n;i++)
{
dp[i]=dp[i-1]+(i-1)*dp[i-2];
}
return dp[n];
}
int main()
{
int n;
int dp[100]={0};
cout<<“number of friends:”<<endl;
cin>>n;
cout<<“no of way:”<<NoOfWays(n,dp);
return 0;
}