Hi all,
I have a sorting program
do i=1,4
do j=i+1,5
if(er(i).gt.er(j))then
temp=er(i)
er(i)=er(j)
er(j)=temp
end if
end do
end do
I am looking how I can print sorted values with their array index as in original data.
example
er=[9,3,2,5,1,4]
sorted er=[1,2,3,4,5,9] & print original index of elements
ie 5,3,2,6,4,1 while printing the sorted output.
Thanks in advance
Charls Antony
I have a sorting program
do i=1,4
do j=i+1,5
if(er(i).gt.er(j))then
temp=er(i)
er(i)=er(j)
er(j)=temp
end if
end do
end do
I am looking how I can print sorted values with their array index as in original data.
example
er=[9,3,2,5,1,4]
sorted er=[1,2,3,4,5,9] & print original index of elements
ie 5,3,2,6,4,1 while printing the sorted output.
Thanks in advance
Charls Antony