summaryrefslogtreecommitdiff
path: root/output/Factorial.java
blob: d938bb659a055d17d020654952b2fab470c2388d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Factorial{
    public static void main(String[] a){
        System.out.println(new Fac().ComputeFac(10));
    }
}

class Fac {
    public int ComputeFac(int num){
        int num_aux ;
        if (num < 1)
            num_aux = 1 ;
        else
            num_aux = num * (this.ComputeFac(num-1)) ;
        return num_aux ;
    }
}