Sir,why in my code sort function is not waorking

#include
#include
using namespace std;
int main()
{
int a[100];
int b[100];
int c[100];
int n;
cin>>n;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cin>>b[i];
}
for(int i=0;i<n;i++)
{
c[i]=a[i];
}
int size=n+n;
for(int i=0,j=n;i<n or j<size;i++,j++)
{
c[j]=b[i];
}
for(int i=0;i<size-1;i++)
{
int min_index=i;
for(int j=i;j<size;j++)
{
if(c[j]<c[min_index])
{
min_index=j;
}
}
swap(c[i],c[min_index]);
}
int s=0;
int e=size-1;
int m;
m=(s+e)/2;
cout<<c[m];
return 0;
}

i have used selection sort for sorting of the array,
when i was using sort function for sorting the array it is not giving the sorted array

it is very difficult to find mistake here
save you code at https://ide.codingblocks.com/
send the link of code generated


sir , from this link you can see the code

sort function is running fine
correct way is
c has no of elements=size so this should be
sort(c,c+size);
for(int i=0;i<size ;i++)cout<<c[i]<<" "; cout<<endl;

you can check

i hope this help
if you have more doubts regarding feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course

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.