| 1 | class FactorialDemo { |
| 2 | public static void main(String args[]){ |
| 3 | int fact = 0; |
| 4 | for (int i=0; i<=10; i++) { |
| 5 | fact = factorial(i); |
| 6 | System.out.println("factorial of "+i+" is: "+fact); |
| 7 | } |
| 8 | |
| 9 | } |
| 10 | static int factorial(int n){ |
| 11 | if (n == 0) |
| 12 | return 1; |
| 13 | else |
| 14 | return(n * factorial(n-1)); |
| 15 | } |
| 16 | |
| 17 | } |
nothing calls this directly
no outgoing calls
no test coverage detected