Interview Solution

The belief that complex systems require armies of designers and programmers is wrong. A system that is not understood in its entirety, or at least to a significant degree of detail by a single individual, should probably not be built. Niklaus Wirth

Recursive Factorial

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

Comments


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,
Example:-
5! = 5 * 4 *3 * 2 * 1 = 120.


Output

   					 
Factorial of '3' is :6

				    

Comments

Posted by secret2006is
March 23, 2016 10:12 am

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



Please login to add comments.