Run ❯
Get your
own Java
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
public class Main { public static void main(String[] args) { int n = 5; int fact = 1; for (int i = 1; i <= n; i++) { fact *= i; } System.out.println("Factorial of " + n + " is " + fact); } }
Factorial of 5 is 120