Factorial Function with recursion

Revision en1, by Meron3r, 2024-02-20 11:44:06
unsigned long long factorial(unsigned int x) {
    
    if (x == 0 || x == 1) return 1;
    
    return x * factorial(x - 1);
    
}
Tags factorial, recursion

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Meron3r 2024-02-20 11:44:06 189 Initial revision (published)