Skip to content

factorial

Vašek edited this page Feb 6, 2019 · 3 revisions

factorial

This function returns factorial of the given number

Syntax:

factorial(n)
Argument Description
int n The given number

Returns: int

Description:

The factorial of a positive integer n, 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 = 120

Example:

int value = factorial(6);

6! = 6 x 5 x 4 x 3 x 2 x 1 = 720. This Function will set value to 720.

Back to number_functions

Clone this wiki locally