Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleChoose
Keywordsquick question, quiz, Choose
CategoriesTips and Tricks
 
Private Function F(ByVal number As Long) As Long
    F = Choose(number, 1, 2, 6, 24, 120, 720, 5040, 40320, _
        362880, 3628800, 39916800, 479001600)
End Function
 
  1. What does this code do?
  2. What's wrong with this technique (aside from the function's name which is intentionally obscure so it's not too obvious what the code is doing)?
  3. Can you think of an alternative approach that's also easy to understand?
  4. Which version is better?

Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated