diff options
| author | bd-912 <bdunahu@colostate.edu> | 2024-04-10 23:40:25 -0600 | 
|---|---|---|
| committer | bd-912 <bdunahu@colostate.edu> | 2024-04-10 23:40:25 -0600 | 
| commit | 1080b37bbe40fe56b919d22804c159cccdca3c95 (patch) | |
| tree | 8ddbb9528f575e537f925b266c8f366be6acc8b7 /boil/tests/Factorial.java | |
| parent | 61a28b7f8e709d1884ccab15f0dc38ed19dfde70 (diff) | |
Library rename, created A4 directories
Diffstat (limited to 'boil/tests/Factorial.java')
| -rw-r--r-- | boil/tests/Factorial.java | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/boil/tests/Factorial.java b/boil/tests/Factorial.java new file mode 100644 index 0000000..d938bb6 --- /dev/null +++ b/boil/tests/Factorial.java @@ -0,0 +1,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 ;
 +    }
 +}
 | 
