1 Replies - 5650 Views - Last Post: 10 March 2010 - 04:18 AM Rate Topic: -----

#1 ozakinspiron  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 10-March 10

Multiplication using for loop

Posted 10 March 2010 - 03:33 AM

hi i have a project and i want a reference how to make a multiplication table using for loop.,pls help me.,thank you
Is This A Good Question/Topic? 0
  • +

Replies To: Multiplication using for loop

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2876
  • View blog
  • Posts: 11,051
  • Joined: 15-July 08

Re: Multiplication using for loop

Posted 10 March 2010 - 04:18 AM

Please help you on what? You have *nothing* so far. I can help you better if you show your current attempt.

But, here's the algorithm:
for each row with variable i
   for each column with variable j
       print (i+1)*(j+1)



As you can see, by multiplying the current row by the current column, you get a multiplication table. please not that i and j are normal for loop variables that begin at 0, so we increment both by 1 before beginning (So there is not a row of 0's
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1