part1b - END DO...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
PROGRAM part1b IMPLICIT NONE INTEGER::number, i, fibo WRITE(*,*)"How many sets of numbers will be displayed?" READ(*,*)number WRITE(*,*)"----------------------" WRITE(*,*)" n FIBO" WRITE(*,*)"----------------------" DO i=1,number WRITE(*,"(3x,I2,5x,I9)")i,fibo(i)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: END DO WRITE(*,*)"----------------------" END PROGRAM RECURSIVE INTEGER FUNCTION fibo(i) RESULT(ans) INTEGER,INTENT(IN)::i IF(i==1)THEN ans=0 ELSE IF(i==2)THEN ans=1 ELSE ans=fibo(i-1)+fibo(i-2) END IF END FUNCTION...
View Full Document

Ask a homework question - tutors are online