Hi, i am given an array of atomic numbers, and I need to arrange them in order from 1-100 or something.
the program i wrote is this
for(fill = 0; fill < (m-1); ++fill)
{
if(atomic_num[index_of_min] <= atomic_num[fill])
{
temp = atomic_num[index_of_min];
atomic_num[index_of_min] = atomic_num[fill];
atomic_num[fill] = temp;
}
++index_of_min;
}
for(j = 0; j < (m-1); j++)
fprintf(outp,"%d\n", atomic_num[j]);
gives these the output below. It only orders 88 in the right order. How should I order all the elements in the right order.
the array of elements
1
1
1
50
84
88
1
1
1
1
1
1
11
20
84
ordering only 88.
1
1
1
50
84
1
1
1
1
1
1
11
20
84
88
how should i make them order 1,1, 1, 1, 11, 20, 84, 84, 88 something like this?
thanks,