fm3_problems37

fm3_problems37 - FIBONACCI IN ACTION n Fibonacci 1 #MACRO?...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: FIBONACCI IN ACTION n Fibonacci 1 #MACRO? #MACRO? 2 #MACRO? #MACRO? 3 #MACRO? #MACRO? 6 #MACRO? #MACRO? 12 #MACRO? #MACRO? 24 #MACRO? #MACRO? A B C D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 VBA Code Function Fibonacci(n As Integer) As Long Dim Temp, t1, t2 As Long Dim i As Integer If n <= 0 Then Fibonacci = 0 ElseIf n = 1 Then Fibonacci = 1 Else t1 = 0: t2 = 1 For i = 2 To n Temp = t1 + t2 t1 = t2: t2 = Temp Next i Fibonacci = Temp End If End Function E 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 HOMEFACTORIAL IN ACTION n HomeFactorial-1 #MACRO? #MACRO? #MACRO? #MACRO? 1 #MACRO? #MACRO? 2 #MACRO? #MACRO? 3 #MACRO? #MACRO? 8 #MACRO? #MACRO? A B C D 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 VBA Code Function HomeFactorial(n As Integer) As Long Dim Temp As Long Dim i As Integer If n <= 0 Then HomeFactorial = 0 Else Temp = 1 For i = 1 To n Temp = Temp * i Next i HomeFactorial = Temp End If End Function E 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 NEWPV IN ACTION CF r NewPV 100.0000 10% #MACRO? #MACRO?#MACRO?...
View Full Document

Page1 / 16

fm3_problems37 - FIBONACCI IN ACTION n Fibonacci 1 #MACRO?...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online