My program for Bubble Sorting with Comparator Function is not working

#include
using namespace std;

bool Compare(int a, int b)

{

return a<b;

}

void Bubble_Sort(int a[], bool (&cmp)(int a, int b))

{

for(int i = 4; i>=1; i--)

{
    for(int j = 0; j<=i; j++)
    {
        if(cmp(a[j], a[j+1]))
        {
            swap(a[j], a[j+1]);
        }
    }
}

}

int main()

{

int a[5] = {0};

for(int i = 0; i<=4; i++)

{

cin>>a[i];

}

Bubble_Sort(a, Compare);

for(int i = 0; i<=4; i++)

{

cout<<a[i]<<" ";

}

return 0;

}

hello @priyam04

pls save ur code at cb ide and share its link with me

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.