text: Program for factorial of a number | C ++ program to find factorial of given number ; function to find factorial of given number ; Driver code
code: #include <iostream> NEW_LINE using namespace std ; unsigned int factorial ( unsigned int n ) { if ( n == 0 ) return 1 ; return n * factorial ( n - 1 ) ; } int main ( ) { int num = 5 ; cout << " Factorial ▁ of ▁ " << num << " ▁ is ▁ " << factorial ( num ) << endl ; return 0 ; }