What is wrong in this ? i think i am not putting the spaces right

#include

using namespace std;

void hollow(int n){

for(int i=0;i<n;i++){
	for(int j=0;j<(2*n);j++){
		if(i+j<=n-1) // upper left triangle
		cout<<"*";
		else 
		cout<<" ";
		
		if((i+n)<=j) // upper right triangle
		cout<<"*";
		else
		cout<<" ";
	}
	cout<<endl;
}

for(int i=0;i<n;i++){
	for(int j=0;j<(2*n);j++){
		
		if(i>=j) // bottom left triangle
		cout<<"*";
		else
		cout<<" ";
		
		if(i>=(2*n-1)-j) // bottom right triangle
	    cout<<"*";
	    
	    else 
	    cout<<" ";
	}
	cout<<endl;
}

}

int main(){
int n;
cout<<“enter number of rows”<<endl;
cin>>n;
hollow(n);
return 0;
}

hello @anuragsen9617
pls save ur code here-> https://ide.codingblocks.com/
and share its link

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.