Question
Please develop subroutine sort for the below program. Hint: maxval, minval,maxloc, or/and minloc commands might be helpful. program Assignment06 implicit none real (Kind=4),dimension(10):: D integer::
Please develop subroutine sort for the below program. Hint: maxval, minval,maxloc, or/and minloc commands might be helpful. program Assignment06 implicit none real (Kind=4),dimension(10):: D integer:: i D=(/-68.47,94.11,91.43,-2.92,60.05,-71.62,-15.64,83.14,58.44,91.89/) call sort(D,'descending') do i=1,size(D,dim=1) print*, D(i) enddo contains subroutine sort(A,order) !======================================================! ! Subroutine SORT receives a one-dimensional array and ! ! sorts it in ascending or descending order. ! ! List of Arguments: ! ! input-&-output, real, A, an unknown size 1D array.! ! input, character, order, should be 'ascending' ! ! or 'descending' otherwise the array is sorted in ! ! ascending order. ! !======================================================! . . end subroutine sort end program Assignment06
fortran program is used, please upload screenshot of result and code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started