• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu
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(🤔🤔🤔); } }

java
6th Mar 2023, 11:17 AM
King Ayoze
2 Answers
+ 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
6th Mar 2023, 12:11 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Thanks
6th Mar 2023, 1:23 PM
King Ayoze

Often have questions like this?

Learn more efficiently, for free:

  • Introduction to Python

    7.1M learners

  • Introduction to Java

    4.7M learners

  • Introduction to C

    1.5M learners

  • Introduction to HTML

    7.5M learners

See all courses
Hot today
Hello World!
0 Votes
What’s the actual difference between MB and GB in real-world usage?
1 Votes
Script file names
0 Votes
What is wrost mistake that mostly people made while learning coding?
0 Votes
Html learn
1 Votes
Je cherche des gens qui parle français pour apprendre le langage c
0 Votes
Java doubt coders
0 Votes
How to put multiple inputs in python?
1 Votes
Python ???
0 Votes
What can I do after learning python and how to create amazing codes. And how many times it would take to be a good programmer😅
0 Votes