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
Get step-by-step solutions from verified subject matter experts
