Saturday, March 12, 2011

Sample PHP codes for Factorial

In mathematics, the factorial of a positive integer n,[1] denoted by n!, is the product of all positive integers less than or equal to n. For example,

5! = 5 x 4 x 3 x 2 x 1 = 20


0! is a special case that is explicitly defined to be 1.[1]
The factorial operation is encountered in many different areas of mathematics, notably in combinatorics, algebra and mathematical analysis. Its most basic occurrence is the fact that there are n! ways to arrange n distinct objects into a sequence (i.e., permutations of the set of objects). This fact was
known at least as early as the 12th century, to Indian scholars.[2] The notation n! was introduced by Christian Kramp in 1808.[3]


Display Output:
















The definition of the factorial function can also be extended to non-integer arguments, while retaining its most important properties; this involves more advanced mathematics, notably techniques from mathematical analysis.



Download the codes here

0 Responses to “Sample PHP codes for Factorial”

Post a Comment

All Rights Reserved DevCod | Blogger Template by Bloggermint