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??
multiplication table..
Page 1 of 18 Replies - 3591 Views - Last Post: 29 March 2011 - 10:42 AM
Replies To: multiplication table..
#2
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....
For Example:
1 x 1 = 1
1 x 2 = 2.... and so on...
or something else....
Runny, 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??
#3
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
Also, can you please start using the Fast Reply textbox to reply instead of quoting the entire topic into your responses?
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?
#4
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
#5
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.....
1x1 = 1 1x2 = 2 1x3 = 3 1x4 = 4 1x5 = 5
I want some advice about this.....
#6
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.
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
#7
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...
#8
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...
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...
#9
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
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|