Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

built in factorial function in c++

int factorial(int n)
{
  return (n == 1 || n == 0) ? 1 : factorial(n - 1) * n;
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #built #factorial #function
ADD COMMENT
Topic
Name
2+3 =