bubble sorting

Write your question here.
Hi there, pls comment my mistakes

#include<iostream>
using namespace std;


int sortingfunc(int arr[], int size)
{
int temp;

for (int i = 0; i < size; i++)
{
for (int j = 0; j > size - i - 1; j++) {

if (arr[j] > arr[j + 1])
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;


return 0;
}
}
}

int main()
{
int arr[] = { 8,9,7,5,9,10,11,12,15,14 };

sortingfunc(arr, 10);

for (int i = 0; i < 10; i++)
{
cout << arr[i] << endl;
}
}
First, please use code tags when posting code. See http://www.cplusplus.com/articles/jEywvCM9/

* Does the code compile?
* Does the program run to completion?
* Are the results as expected?

I can see at least three logical errors (and questionable output formatting).
Topic archived. No new replies allowed.