0
Pls help me with this.I want take an input and output the factorial of that input
Scanner sc = new Scanner(System.in); int N = Scanner.sc.nextInt(); int 🤔🤔🤔 = 1; for(int x= 1;x<=N;x++) { 🤔🤔🤔 *=x; } System.out.println(🤔🤔🤔); } }
2 odpowiedzi
+ 3
You'll enjoy recursion.
https://www.sololearn.com/discuss/296069/?ref=app
https://www.sololearn.com/discuss/2055474/?ref=app
https://code.sololearn.com/c5A8aioWW4fZ/?ref=app
https://code.sololearn.com/c2H6Y0yZAlOI/?ref=app
https://code.sololearn.com/cZ11hPNQ5xr5/?ref=app
https://code.sololearn.com/cj7pAcAEmqTm/?ref=app
+ 1
Thanks