You have to use ... Sorting algos ... like insert sort, merge ..etc
I am giving you the code for Insert Sort Ok !!
int temp ;
for( int j = 1; j<aa.length ; j++)>
{
for( int i = 0; i<j ; i++)>
{
temp = aa[i];
aa[i] = aa[j];
aa[j] = temp;
}
}
Originally posted by Khurram Akhter:
I made an array
int []aa = { 1,5,2,6,7,9,8}
I want to sort this array with the help of for loop, so what
should i do now....