Sudoku solver recursion

it shows segmentation fault
#include
#include
using namespace std;

bool canplace(int a[][11],int i,int j,int no,int n){

for(int x=0;x<n;x++){
	if(a[x][j]==no || a[i][x]==no){
		return false;
	}
}

int rn=sqrt(n);
int sx=(i/rn)*rn;
int sy=(j/rn)*rn;
for(int i=sx;i<sx+rn;i++){
	for(int j=sy;j<sy+rn;j++){
		if(a[i][j]==no){
			return false;
		}
	}
}
return true;

}
bool sudoku(int a[][11],int i,int j,int n){

if(i==n-1 && j==n-1){
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			cout<<a[i][j];

		}
		cout<<endl;
	}
	return true ;
}

if( j>n-1 ){
return sudoku(a,i+1,j,n);
}
if(a[i][j]!=0){
return sudoku(a,i,j+1,n);
}

for(int no=1;no<=n;no++){
	if(canplace(a,i,j,no,n)){
		a[i][j]=no;
         bool rakpaye=sudoku(a,i,j+1,n);
		if(rakpaye==true){
			return true ;
		}
		
	}

}
a[i][j]=0;

return false;
}
int main() {
int a[11][11];
int n;
cin>>n;

for(int i=0;i<n;i++){
	for(int j=0;j<n;j++){
		cin>>a[i][j];
	}
}
sudoku(a,0,0,n);
return 0;

}

hi @kumarakash121005
try this -->

what is wrong in my code

save ur code on coding blocks ide and send… will check it…

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.