It still not working properly why

#include
using namespace std;
int main(){
int i,j,n;
cin>>n;
cout<<"\n";
for(i=1; i<=n; i++){
for(j=i; j<=n-1; j++){
cout<<" “;
}
for(j=i; j<=n; j++){
if(i==1 || i==n || j==1 || j==n){
cout<<”*";
}
else{
cout<<" ";
}

}
cout<<"\n";
}
return 0;
}

hi @rathidevesh906_1dcc73a061c159bb,
your logic is not correct completely refer here https://ide.codingblocks.com/s/659217
its commented code