summaryrefslogtreecommitdiff
path: root/base/Factorial-error.java
blob: 46ec59a22cfd86541178847ed4d50c0bb85c4124 (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 boolean ComputeFac(int num){  //TE
        int num_aux ;
        if (num < 1)
            num_aux = 1 ;
        else
            num_aux = num * (this.ComputeFac(num-1)) ;
        return num_aux ;
    }
}