This preview shows page 1. Sign up to view the full content.
Unformatted text preview: IMPLICIT NONE INTEGER, INTENT(IN)::number IF (number==0)THEN answer=1 ELSE answer=number * FACT2(number-1) END IF END FUNCTION FACT2 !subroutine RECURSIVE SUBROUTINE FACT1(number, result) IMPLICIT NONE INTEGER,INTENT(IN)::number INTEGER, INTENT(OUT)::result INTEGER::temp IF(number==0)THEN result=1 ELSE CALL FACT1(number-1, temp) result=number*temp END IF END SUBROUTINE FACT1...
View Full Document
This note was uploaded on 07/22/2010 for the course MAE 112 taught by Professor Freeh during the Spring '10 term at North Country Community College.
- Spring '10