Multiplication table

  • 6
  • Locked
In ancient times, when robots were few, human children were forced to learn the multiplication table. How cruel! Multiplication tables were written by hand over and over in notebooks. What a waste! We won't sully any paper, and there's no reason to teach you the table. Simply display it on the screen. Here's your secret weapon: the while loop.
You can't complete this task, because you're not signed in.
Comments (59)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
qaz_gangnam
Level 7 , Korea, Republic of
3 May, 13:25
I see many people solved this with "for", am I supposed to know this already? Are we going to learn this later in this course?
Lunita
Level 4
14 January, 02:36
I got it with a for loop inside a While loop. 2 variables to count and 1 to store the product.
manuelguijarro
Level 4 , Spain
1 December 2022, 10:39
for(int j=1; j<=10;j++){ for(int i = 1; i<=10;i++){ System.out.print((i*j) + " "); } System.out.println(); }
Anonymous #11180958
Level 6 , Alicante, Spain
21 November 2022, 22:23
I took the suggestion of the exercise and created like 10 while loops 😅 just tried with nested for loops and its so much shorter
niraed
Level 5 , Spain
8 October 2022, 23:50
Yo he creado la tabla a partir de un while y dentro un for. Entrar en arrays me parecía demasiado avanzado y ni siquiera sé cómo van en Java xD
Farhan Khan
Level 4 , United States
5 February 2022, 18:54
Why does this exercise want us to use loop when we have not been taught loop yet? Can any CodeGym employee answer this question?
John Squirrels Website Admin at CodeGym
7 February 2022, 08:44
The course may contain the tasks-from-the-future. If you do not have the idea how to solve it now, you can skip it and come back when you cover the lecture.
Elias Daniel Hung
Level 4 , Caracas
2 July 2021, 23:21
estuve tres días tratando de resolver este ejercicio
Elias Daniel Hung
Level 4 , Caracas
2 July 2021, 23:21
Hay que saber la diferencia entre = y == porque en el condicional if puede presentarse un error
Elias Daniel Hung
Level 4 , Caracas
2 July 2021, 23:19
yo utilicé dos ciclos for para eso investigué que eran esos ciclos, y algo que se llama algoritmo en Internet
Jomar Tayactac
Level 3 , Winnipeg, Canada
Expert
19 May 2021, 21:12
This task can be done without using a loop, your code will just be longer. If you'd like to use a loop but haven't learned it yet, simply google it.