Doble sided arrow (i got correct the above part of pattern please tell where i m going wrong

include
using namespace std;
int main() {
int n;
cin>>n;
int val;
for(int i=1;i<=n-3;i++){
for(int s=1;s<=n-(2*i-1);s++){//spaces for top
cout<<" “<<” ";
}
val=i;

	for(int j=1;j<=i;j++){//de4cresing  no
		
		cout<<val<<" ";
		val--;
	}
	for(int s=1;s<=(2*i-3);s++){
		cout<<" "<<" ";
	}
	val++;
	if(i>1){
          for(int j=1;j<=i;j++){
		   cout<<val<<" ";
		    val++;
		}
	}

   cout<<endl;
}
for(int i=1;i<=n-4;i++){
	for(int s=1;s<=i;s++ ){
		cout<<" "<<" "<<" "<<" ";
	}
	val=4-i;
	for(int j=1;j<=4-i;j++){
		cout<<val<<" ";
		val--;
	}
	val++;
    if(i!=n-4){
        for(int s=1;s<=(n-3)-i;s++){
		    cout<<" "<<" ";
	    }
	
        for(int j=1;j<=4-i;j++){
		 cout<<val<<" ";
		 val++;
	    }
	}
	
     cout<<endl;
}
return 0;

}

please share code in cb ide

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.