Program Fibonacci2 !------------------------------------------------------------------------------ !Program: Fibonacci with Do (For) Loops continued !Author: Chris Harper !Date: 1/31/2008 !------------------------------------------------------------------------------ IMPLICIT NONE !declarations integer :: n, i, c real :: a, b, d !get input var Print *, "Fibonacci with Do Loops" Print *, "How many terms?" Read *, n !init first two terms a = 1 b = 1 print "(1X, T2, A10, T14, A10)", "Term", "Ratio" !iterate from 1 to user input n do i = 1, n if (i < 3) then c = 1 !first two terms are 1 d = 1 else c = a + b !subsequent terms are the sum of the last two terms d = c / b !ratio a = b b = c endif print *, c, d enddo End