In: Computer Science
Create a Factorial application that prompts the user for a number and then displays its factorial. The factorial of a number is the product of all the positive integers from 1 to the number. For example, 5! = 5*4*3*2*1. I also need an algorithm and pseudocode in java please
// Screenshot of the code & output

// Code to copy
Factorial.java
import java.util.Scanner;
public class Factorial {
public static void main(String[] args) {
int n;
Scanner scnr= new
Scanner(System.in);
System.out.print("Enter a number:
");
n=scnr.nextInt();
System.out.println("Factorial:
"+factorial(n));
scnr.close();
}
private static int factorial(int n)
{
if(n<0) {
return 0;
}else if (n == 0) {
return 1;
}else {
return
n*factorial(n-1);
}
}
}