Skip to content

Instantly share code, notes, and snippets.

@neokoenig
Created May 16, 2011 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neokoenig/974463 to your computer and use it in GitHub Desktop.
Save neokoenig/974463 to your computer and use it in GitHub Desktop.
Fibonacci Loop
<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