• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to make this output multiplication using array in java

 
Siti Zulaiha Khasnan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
example : if input is 2, print the 2 tables in the following format :
1*2 = 2
2*2 = 4
3*2 = 6
4*2 = 8
5*2 = 10
6*2 = 12
7*2 = 14
8*2 = 16
9*2 = 18
10*2 = 20
 
Junilu Lacar
Bartender
Posts: 7480
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why you even need an array to do that. Just use a for-loop.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Step 1) turn off your computer
Step 2) get paper and pencil
Step 3) write down in English (or any other natural language of your choice) the steps you would give a 10 year old child if they had to do this by hand.
Step 4) revise that list at least 5 times, further simplifying and clarifying the steps each time.

ONLY when you have completed the above should you consider writing a single line of code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic