Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

factorial of a number using recursion in java

public int factorial(int num) {
        if (num == 0)
            return 1;
        else
            return (num * factorial(num - 1));
    }
 
PREVIOUS NEXT
Tagged: #factorial #number #recursion #java
ADD COMMENT
Topic
Name
7+8 =