Bubble sort recursion

void bubble_sort_recursive(int *a,int j,int n)
{
if(n==1)
{
return;
}
if(j==n-1)
{
bubble_sort_recursive(a,0,n-1);
}
if(a[j]>a[j+1])
{
swap(a[j],a[j+1]);
}
bubble_sort_recursive(a,j+1,n);
return;
}
int main()
{
int a[]={3,2,4,1,56,23};
int n=sizeof(a)/sizeof(int);
bubble_sort_recursive(a,0,n);
for(int j=0;j<n;j++)
{
cout<<a[j]<<" ";
}
return 0;

}
this code is running perfectly but not giving output.please tell me my mistakes.

Hey @Abhishmu5,

Always share your code using the Online IDE.
The way you have shared it may introduce many syntax errors to it.
STEPS:

  1. Paste the code at: https://ide.codingblocks.com/
  2. Save it there.
  3. Share the URL generated.

sir, i have understood the mistake, thank u

Great @Abhishmu5,

Please, mark it as resolved.

hi @Abhishmu5 have you re-opened this doubt?

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.