Product of 10 numbers

  • 3
  • Locked
Do you think you can easily multiply ten consecutive numbers from 1 to 10 in your mind? If this seems easy to you, you've probably never tried it. Here's a hint: the product is not a small number; it's more than three million. But this is easy for a computer: the important thing is to tell it how to do it.
You can't complete this task, because you're not signed in.
Comments (27)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
RUBEN CABRERA
Level 1 , Koxhausen, Germany
Expert
15 August 2021, 02:30
Could you give me a better explanation about this task I do not understand.
Cleber Machado Backend Developer
15 October 2021, 12:25
😅😅😅 1 * 2 .....9 * 10
18 June 2021, 09:59
Just multiply 1-10 inside System.out.println();
Java_Mooood
Level 3 , San Antonio, United States
16 October 2020, 19:32
No loop is needed , just println
Tim Said
Level 12 , Kiel, Germany
4 October 2020, 17:05
Did it with a for-loop. My result was correct however it said that the last two tasks, - The displayed number should be more than three million. - The displayed number must match the task conditions. are not correct. Used a simple println method and then it worked. No idea why the loop didn't work although the result was the same
Roman
Level 41
5 October 2020, 06:08
Give me your code with a for-loop in PM, I'll check it.
Ahmad Dabagh
Level 9 , Hannover, Germany
18 September 2020, 12:10
I did it in the Hard Way but i did it finaly with 10 for loops inside each other
Constantin Anton
Level 7 , Coventry, United Kingdom
14 August 2020, 21:18
Simple, do not multiply 10 number at once but x = 1 * 2 * 3 ; y = x * 4 * 5 * 6 etc.
Roman
Level 41
17 August 2020, 05:30
Why?)
AlasCaras
Level 4 , Corpus Christi, United States
16 February 2021, 05:09
correct!
Barsha
Level 4 , Eluru, India
14 July 2020, 06:31
I am getting an output of 9864100. Incrementing i in the for loop: for(int i =0;i<=10;i++) int z is the product z*=i and then incrementing z. Printing out the output (z) outside the for loop. My code still fails the last task condition. Please help debug what I am doing wrong
Roman
Level 41
14 July 2020, 07:03
Please post your question with the attached solution in the section Help. 1*2*3*...*10 = 3 628 800
Edddieg
Level 15 , Providence, United States
5 June 2020, 16:19
best to use factorial to solve this problem
Nastya
Level 19 , Moscow, Russia
2 May 2020, 15:04
I think recursion is a better way to solve the problem
Deborah Wenrich
Level 7 , Pembroke Pines, United States
5 November 2019, 22:42
int z is my friend, i made it do all the work.