Created
May 16, 2011 13:45
-
-
Save neokoenig/974463 to your computer and use it in GitHub Desktop.
Fibonacci Loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset n1 =0> | |
<cfset n2 =1> | |
<table> | |
<thead> | |
<tr><th>Row</th><th>No.</th><th>Length</th> | |
</thead> | |
<tbody> | |
<cfloop from="1" to="1000" index="i"> | |
<cfset x = (n1 + n2)> | |
<cfoutput> | |
<tr><td>#i#</td><td>#len(numberformat(x))#</td><td>#numberformat(x)#</td></tr> | |
</cfoutput> | |
<cfset n1 = n2> | |
<cfset n2 = x> | |
</cfloop> | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment