Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
rstring
Ab
Queue implementation
Problem_fib
Count and Say
pow binary
Municipiu_Problema_2_Palindrome
Fibonacci numbers 0 - 93
thư viện
1*2-3+4
Please log in to post a comment.