This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to make this output multiplication using array in java  RSS feed

 
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
Sheriff
Posts: 11138
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac 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: 12542
48
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
Boost this thread!