Docstoc

ARRAY SORTING

Document Sample
ARRAY SORTING Powered By Docstoc
					# include <iostream.h>
# include <stdlib.h>

main()
{
int a[5] = {5,2,4,1,9};
int t,s;

cout<<"the array to be sorted is\t5,2,4,1,9\n";

for (int i=0; i<5;   i++)
{
for (int j=0; j<5;   j++)
{
s =0;
if (a[i]>a[j+1]);
{
s++;
  t = i;
  i = j+1;
  j = t;
   }
    }
}
for (int i=0; i<5;   i++)
{
for (int j=0; j<5;   j++)
{
cout<<'\t'<<t<<" "   ;
}
cout<<endl;
}


system("PAUSE");
}

				
DOCUMENT INFO
Shared By:
Tags: ARRAY
Stats:
views:4
posted:9/20/2012
language:
pages:1
Description: ARRAY SORTING LECTURE