Question: Write an external function subprogram in Fortran 90 to calculate the GCD of two integers (a and b). First solve using non-recursive algorith and then

Write an external function subprogram in Fortran 90 to calculate the GCD of two integers (a and b). First solve using non-recursive algorith and then by recursive algorithm.

The Euclidean algorith for finding GCD (a,b) is as follows : if b = 0, GCD (a,b) = a. Otherwise let a = bq + r, where q is quotient and r is the remainder. GCD (a, b) = GCD (b, r).

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!