# include
using namespace std;
Const int N=6;
Void bubble_sort (int unsorted [], int n)//sorting
{
Int flag=0, m=0;
For (int I=0; i
For (int j=0; j
flag=0;
If (unsorted [j] & gt; Unsorted [m + 1])
{
Int temp=unsorted [j + 1);
Unsorted [j + 1)=unsorted [j];
Unsorted [j]=temp;
flag=1;
m++;
}
}
if(! Flag) break;
}
cout<" The actual "& lt;
Void the display (int x [], int n)
{
For (int I=0; i
Int main ()
{
Int x [N];
for(int i=0; I
cout<" Sort the data before: "& lt;
cout
cout<" After sorting sequence: "& lt;
cout
}
The flag at work?
[code=c] [code]=c[code=c] [/code] [/code] [/code]