Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions