From 1080b37bbe40fe56b919d22804c159cccdca3c95 Mon Sep 17 00:00:00 2001 From: bd-912 Date: Wed, 10 Apr 2024 23:40:25 -0600 Subject: Library rename, created A4 directories --- boil/tests/Factorial.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 boil/tests/Factorial.java (limited to 'boil/tests/Factorial.java') 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 ; + } +} -- cgit v1.2.3