Question: WRITE A PROGRAM IN FORTRAN 90 - to reverse an integer Write and test a recursive subroutine PrintReverse that accepts an integer and displays it

WRITE A PROGRAM IN FORTRAN 90 - to reverse an integer

WRITE A PROGRAM IN FORTRAN 90 - to reverse an integer Write

Write and test a recursive subroutine PrintReverse that accepts an integer and displays it in reverse order. The program is as follows, but the subroutine is missing. Hint: For an integer n, we can print the reverse order of n as follows. First print the last digit of n and then print other digits (which is n/10) in reverse order program testPR implicit none integer :: n print *, "this program test a subroutine PrintReverse" write(*, , (1x, a)', advance = "NO") "input a positive integer n: " read *, n print *, "The number ",n, "in reverse order is:" call PrintReverse (n) contains recursive subroutine PrintReverse(n) end subroutine PrintReverse end program testPR

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!