MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / FactorialDemo

Class FactorialDemo

Programs/FactorialDemo.java:1–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected