smallN.f90
I suggest you either typed this as it appears into the compiler, or as
an easier way, just copy and paste it!
Note: I do not claim
the program will 100% work, but I give it my best. If it doesn't, try tweaking
it yourself, or email me about it, and I'll modify and post the improved version
later. Good luck!
PROGRAM small_n_value
IMPLICIT NONE
INTEGER :: n
PRINT*, "Welcome to ADCY Smallest Number Comparer"
WRITE (UNIT=*, FMT=10, ADVANCE="NO") "Please tell me how many numbers you wanted compared:"
READ*, n
10 FORMAT (A)
PRINT*
CALL get_the_n(n)
PRINT*
PRINT*, "Thank you for using ADCY Smallest Number Sorter"
PRINT*, "Have a nice day:)"
END PROGRAM small_n_value
!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SUBROUTINE get_the_n(nn)
IMPLICIT NONE
INTEGER, INTENT(in) :: nn
REAL :: small
REAL, DIMENSION(1:nn) :: array
PRINT*, "Please enter the numbers:"
READ*, array
small=MINVAL(array)
PRINT*
PRINT*, "The smallest value is:", small
END SUBROUTINE get_the_n