Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 1

program Sort !MANALO, ARDEE C. and CASTRO, CYRA GERINA R. !B-1L !

THIS PROGRAM IS USED TO SORT NUMBERS IN INCREASING ORDER. integer A(1000),n,b 10 print*, "How many numbers would you like to sort?" read*, n do i=1,n print*,"Input the",i,"th number." read*, a(i) end do do i=1,n do j=1,n if (a(i) .gt. a(j)) then a(i)=a(i) else c=a(i) a(i)=a(j) a(j)=c end if end do end do print*, "The numbers (sorted in increasing order) are:" do i=1,n print*, a(i) end do print*, "Do you want to use this program again? Type1, if YES. Otherwise, type any number." read*,b if (b==1) then goto 10 else print*, "Thank you for using this program." end if end

You might also like