Please explain the logic how to print the rows from 6th row to the 9th row

#include
using namespace std;
int main() {
int n, i , j ;
cin>>n;
for (i =0; i<2n ; i++){
if(i<n+1){
if (i == 0 ){
for(j =0; j<n+n-1;j++){
cout<<"
";
}
cout<<endl;
}
else{
for(j=0; j<=n-i; j++){
if(j==n-i){
for(int k=0; k<i*2-1;k++){
cout<<" ";
}

				}
				else{
					cout<<"*";
				}
				}
			for (int k=0; k<n-i; k++){
					cout<<"*";
				}
				cout<<endl;
			}	
		}
	else{
	if (i == 2*n-1 ){
			for(j =0; j<n+n-1;j++){
				cout<<"*";
			}
			cout<<endl;
		}
		else{
			for(j=0; j<=n; j++){
				if(j==n-i){
					for(int k=0; k<i*2-1;k++){
						cout<<" ";
					}
								
				}
				else{
					cout<<"*";
				}
				}
			for (int k=0; k<n-i; k++){
					cout<<"*";
				}
				cout<<endl;
			}	
		}
	
}


return 0;

}

hi @discobot,
refer

Hi! To find out what I can do, say @discobot display help.

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.