Compile and run the following program. The output should be120.
![public class Factorial public static int fact(int n) if(n-= 1) { return 1; else return n fact(n - 1); public static void main(String] args) System.out.println(fact(5));](https://d2vlcm61l7u1fs.cloudfront.net/media%2F745%2F745afa41-e2d3-4daa-8acf-c6d6f3001fb5%2FphpFu9iX4.png)
Task 1: Factorial1.java
Modify the previous program to print:
Task 2: Factorial2.java
Modify the previous program to print
Task 3: Factorial3.java
Modify the previous program to print

Task 4: CountToMiddle.java
Write a program, using recursion, to count to the middle fromthe beginnings and from the end. For example, countToMiddle(0, 10)should output:

and countToMiddle(5, 22) should output

Answers
PayPal Gateway not configured
PayPal Gateway not configured