Created
July 18, 2012 21:21
-
-
Save anonymous/3138979 to your computer and use it in GitHub Desktop.
Fizz Buzz
This file contains 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
<!--- cf function that solves the fizzbuzz test ---> | |
<cffunction name="displayFBMsg" access="private" hint="whatever..."> | |
<cfargument name="numberOfIterations" required="true" type="numeric"> | |
<cfloop from="1" to="#arguments.numberOfIterations#" index="i"> | |
<cfif i MOD 3 EQ 0 OR i MOD 5 EQ 0> | |
<cfif i MOD 3 EQ 0>fizz</cfif><cfif i MOD 5 EQ 0>buzz</cfif> | |
<cfelse> | |
<cfoutput>#i#</cfoutput> | |
</cfif> | |
</br> | |
</cfloop> | |
</cffunction> | |
<!--- call the function ---> | |
<cfoutput>#displayFBMsg(100)#</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment