Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

calculate factorial

int factorial(int n) {
	int res = 1, i; 
    for (i = 2; i <= n; i++) 
        res *= i; 
    return res; 
}
 
PREVIOUS NEXT
Tagged: #calculate #factorial
ADD COMMENT
Topic
Name
1+2 =