Hi, you're trying to do the bubble sort, so let's check this:
for(int x=0;x < size;x++){
cout<<"Enter a number in your array"<< endl;
cin >> arr[x];
if(arr[x]>= arr[x+1]);
arr[x] = arr[x+1];
arr[x+1] = arr[x];
}
you are reading the pos "x" before read the pos "x+1", you need first read all the array,
by the way, the if doesn't need ";"
for(int x=0;x < size;x++){
cout<<"Enter a number in your array"<< endl;
cin >> arr[x];
}
for(int i=0;i<size;i++){
if(arr[i]>arr[i+1]){
aux=arr[i];
arr[i]=arr[i+1];
arr[i+1]=aux; // You need an auxiliar to change two numbers, because // when you do arr[i]=arr[i+1], the information of arr[i] is lost
}
}
and finally print the array
for(int i=0;i<size;i++){
cout<<arr[i]<<" ";
}