Multiplication table

  • 4
  • 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 (13)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
David
Level 5
26 July 2021, 07:33
I used also a while loop but the task is not validated: "The program should display a 10x10 multiplication table." I took care of spaces and returns but it's not that..
Jaime Padilla
Level 22 , Chandler, United States
19 April 2021, 18:47
I used one while loop and two if statements
Tyler Evans
Level 6 , Wallasey, United Kingdom
24 August 2020, 23:04
I am actually quite proud of myself that was hard. if you are stuck. this may help someone but i used a while in a while with two index variables. good luck.
monipuff
Level 14 , United Kingdom
25 June 2020, 10:04
One of the situations when using System.out.print() instead of System.out.println() comes in handy...
Ian De Bie Full Stack Developer
24 June 2020, 05:42
technically it said must use a while loop, but not must use two while loops, soooo, yeah...
oli blaustrom
Level 18 , Luzern, Switzerland
15 November 2019, 18:10
no console for this one? I'm getting the 10 x 10 error but I can't check
Cam
Level 22 , Austin, United States
11 October 2019, 02:12
Dang what a brain teaser! Good one. Yeah its a kinda thing
Ahmed
Level 23 , Amsterdam, Netherlands
30 April 2019, 23:00
I really enjoyed this one. Hint: Inception loop :)
Glenn Meyer
Level 8 , Cleveland, United States
29 October 2019, 01:43
Sure, but you can easily do this with a single loop too. :)
23 August 2020, 01:35
Can you show the code for making a multiplacation table with a single loop ?
Glenn Meyer
Level 8 , Cleveland, United States
10 September 2020, 15:08
Using one while loop, you can make this work by multiplying x by an increasing y value, then resetting y to 1 and incrementing x. Obviously this way doesn't scale very well if you need a LOT of numbers, but for values around 10 or less, iterating by hand isn't terribly tedious or time-consuming.
Rishabh roy
Level 7 , San Jose, United States
23 April 2019, 08:14
anyone please help me
Roman
Level 41
24 April 2019, 06:09
If you need help, describe your question/issue in the HELP section at codegym.cc/help.