[Challenge] Fibonacci Sequence
2013-08-09, 12:43 PM,
Heyy y'all,

I'm going to provide you with a snippet that solves for the Fibonacci sequence using two variables.
Write me a proof that explains why this works.
Alternatively, write your own piece of code using two variables.

Share This Thread :

2013-08-28, 03:59 PM,
Here's a simple Fibonacci sequence that I wrote in my class yesterday. It uses 4 variables but meh. Here it is anyways in good old VB.NET xD:

Public Class Form1
    Dim intNumber As Integer = 1
    Dim intFirstPrev As Integer = 1
    Dim intSecPrev As Integer = 0
    Dim intLoop As Integer

    Private Sub btnComp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnComp.Click
            intLoop = intLoop + 1
        Loop Until intLoop = 10

    End Sub

    Sub calculate()
        intNumber = intFirstPrev + intSecPrev
        intSecPrev = intFirstPrev
        intFirstPrev = intNumber
    End Sub
End Class

About Us | Contact Us | CPA Elites | Advertise | Stats

© 2013-2019 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top