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.
jb15.0
Qu1java.java
extends
Simple imitation for show banners on priorities
exp6
java
inheritance
3b
Size and signedness of Java ints and longs
Path finding given 2D array
Please log in to post a comment.