<RECURSIVE Example Program>

Program recursive_example
  Print *, ifactorial(5)
End Program
Recursive Integer Function ifactorial( i ) Result( res )
  If (i<2) Then
    res = 1
  Else
    res = i*ifactorial( i-1 )
  End If
End Function

■ Execution Results

 120