8 Replies - 8076 Views - Last Post: 29 March 2011 - 10:42 AM Rate Topic: -----

#1 Runny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 11

multiplication table..

Posted 26 March 2011 - 02:10 AM

I have a command button to display a multiplication table in list box. the multiplication is from 1 to 5. my problem is, I have to use if else or looping in coding??
Is This A Good Question/Topic? 0
  • +

Replies To: multiplication table..

#2 NavilShah  Icon User is offline

  • D.I.C Head

Reputation: 6
  • View blog
  • Posts: 50
  • Joined: 02-November 10

Re: multiplication table..

Posted 26 March 2011 - 04:30 AM

Can you please give me an example of how you want to display....

For Example:
1 x 1 = 1
1 x 2 = 2.... and so on...
or something else....

View PostRunny, on 26 March 2011 - 02:40 PM, said:

I have a command button to display a multiplication table in list box. the multiplication is from 1 to 5. my problem is, I have to use if else or looping in coding??

Was This Post Helpful? 0
  • +
  • -

#3 CharlieMay  Icon User is offline

  • This space intentionally left blank
  • member icon

Reputation: 1605
  • View blog
  • Posts: 5,162
  • Joined: 25-September 09

Re: multiplication table..

Posted 26 March 2011 - 06:08 AM

Runny,
show us the code you created to do what you've got so far. We're not going to just write out the code for you to walk away with.

NavilShah,

I would assume the layout to be something like

  1   2   3   4   5
  2   4   6   8  10
  3   6   9  12  15
etc...

Also, can you please start using the Fast Reply textbox to reply instead of quoting the entire topic into your responses?
Was This Post Helpful? 0
  • +
  • -

#4 dbasnett  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 109
  • View blog
  • Posts: 605
  • Joined: 01-October 08

Re: multiplication table..

Posted 26 March 2011 - 07:02 AM

I have to say that it isn't clear at all which reply is the fast reply since they are both named Reply with the only difference being the icon. Unless of course you are referring to the box at the bottom of the page...

This post has been edited by dbasnett: 26 March 2011 - 07:03 AM

Was This Post Helpful? 0
  • +
  • -

#5 Runny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 11

Re: multiplication table..

Posted 26 March 2011 - 09:36 AM

the output will be like this...
1x1 = 1 1x2 = 2 1x3 = 3 1x4 = 4 1x5 = 5

I want some advice about this.....
Was This Post Helpful? 0
  • +
  • -

#6 nandureddy  Icon User is offline

  • D.I.C Head

Reputation: 28
  • View blog
  • Posts: 129
  • Joined: 31-January 11

Re: multiplication table..

Posted 26 March 2011 - 09:56 AM

As CharlieMay said, paste your code using the 'code' tags so that we can guide you.

If you are looking for the logic,

a) just declare two variables and their product as integers,

b ) assign values for the variables using the 'for' loop

c) and use the 'print' command to print the output in the format -- 1x1 = 1 1x2 = 2 1x3 = 3 1x4 = 4 1x5 = 5.

This post has been edited by nandureddy: 26 March 2011 - 09:58 AM

Was This Post Helpful? 1
  • +
  • -

#7 Runny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 11

Re: multiplication table..

Posted 26 March 2011 - 09:19 PM

a lot of thank you for the replying.. I will try to do first by a note that I have...
Was This Post Helpful? 0
  • +
  • -

#8 Runny  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-March 11

Re: multiplication table..

Posted 29 March 2011 - 08:50 AM

i try to code the program but the output is different..

the code the i write is..

Dim Number as integer

number = 1
while number <= 5
picMultiplication.Print "1x1 =" & number

number = number * 1

Loop


i really sure that i totally wrong...
Was This Post Helpful? 0
  • +
  • -

#9 3P1C_F@!l  Icon User is offline

  • D.I.C Head

Reputation: 8
  • View blog
  • Posts: 98
  • Joined: 01-March 11

Re: multiplication table..

Posted 29 March 2011 - 10:42 AM

I have no idea what the hell you just wrote was.. I am assuming you are making a console application.. here is a start for you.



    Sub Main()
        Dim N As Integer

        N = 1
        While N <= 5

            Console.WriteLine("1x" + N.ToString + " = " + N.ToString)
            N = N * 1
            N = N + 1

        End While

        Console.Write("Press enter to continue")
        Console.ReadLine()

    End Sub



This post has been edited by 3P1C_F@!l: 29 March 2011 - 10:44 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1