The document describes recursive functions for calculating factorials. It provides the mathematical formulas for calculating factorials of different numbers like 5!, 4!, etc. It then shows a recursive function in code that calculates the factorial of a given number n by checking if n is 1, in which case it returns n, or else it returns n multiplied by the factorial of n-1.
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
20 views
Computer Language Lecture 28
The document describes recursive functions for calculating factorials. It provides the mathematical formulas for calculating factorials of different numbers like 5!, 4!, etc. It then shows a recursive function in code that calculates the factorial of a given number n by checking if n is 1, in which case it returns n, or else it returns n multiplied by the factorial of n-1.