The solution I wrote for this problem is
#include
using namespace std;
int main(){
int n;
cin>>n;
int count=n;
for(int i=-1;i<n-2;i++){
for(int j=0;j<=2*(n-1);j++){
if((n-(i+1))<=j&&j<=(n+(i-1))){
cout<<" “;
}
else{
cout<<”*";
}
}
cout<<endl;
}
for(int i=0;i<=n+1;i++){
for(int j=1;j<2*n;j++){
if(n-count<=j&&j<=n+count){
cout<<" ";
}
else{
cout<<"*";
}
}
cout<<endl;
count=count-1;
}
}
Im not getting the desired output