Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Factorial using recursion in java
import java.io.*; class Rextester { static int f=1; public static void main(String args[])throws IOException { DataInputStream ob=new DataInputStream(System.in); int a=5; int x=fact(a); System.out.print(x); } public static int fact(int a) { if(a==1) { return f; } else { f=f*a; return(fact(--a)); } } }
run
|
edit
|
history
|
help
0
Abhay
Repeated Character Count In java
생성자
project euler 12, java
Escaping Literals (Table of records)
Intersection of Array
apple1
Granite Java
default constructor
different ways to add parenthesis leetcode #241