Interview Solution

If debugging is the process of removing software bugs, then programming must be the process of putting them in. Edsger Dijkstra

Recursive Factorial

Language Java | Level Intermediate | Category Interview Problems | July 24, 2015 4:52 pm


Interview Problem

Write a Factorial function using the recursive function.
Write program to find the factorial of the given number using recursive
The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,
5! = 5 * 4 *3 * 2 * 1 = 120.


Factorial of '3' is :6



Posted by secret2006is
March 23, 2016 10:12 am

try: fact( -2 ) ==> Exception in thread "main" java.lang.StackOverflowError

Please login to add comments.