Okay umm i have a question
if i wanna make a "table" in C#,
i.e. * 9x1=9
9x2=18
so on...
with me only pressing enter, and not typing in "2" or "3" everytime.
how do i loop it? so it repeats the action instead of exiting when i press enter after
the code for the first one?
This is my code so far.
C#
Started by
Black_Belt_v1
, Sep 14 2005 10:12 PM
3 replies to this topic
#1
Posted 14 September 2005 - 10:12 PM
#2
Posted 15 September 2005 - 02:16 PM
Try a For...Next loop
I'm not a C# programmer but this should help i hope
(This is not C# it's Psuedo-Code, it should give the idea)
Psuedo-Code:
Dim TimeTable1 as integer
Dim ChangingNumber as Integer
Dim Answer as Decimal
TimeTable1 = 9 'Change the number as its what numbers are times by
ChangingAnswer = 0 'Will be times by the above chosen number
Answer = 0 'Keep as 0 so it can be added onto
Do While Index <= 10
Answer = TimeTable1 * ChangingNumber
ChangingNumber = ChangingNumber + 1
console1.write(answer)
Loop
Hope this helps.
James
I'm not a C# programmer but this should help i hope
(This is not C# it's Psuedo-Code, it should give the idea)
Psuedo-Code:
Dim TimeTable1 as integer
Dim ChangingNumber as Integer
Dim Answer as Decimal
TimeTable1 = 9 'Change the number as its what numbers are times by
ChangingAnswer = 0 'Will be times by the above chosen number
Answer = 0 'Keep as 0 so it can be added onto
Do While Index <= 10
Answer = TimeTable1 * ChangingNumber
ChangingNumber = ChangingNumber + 1
console1.write(answer)
Loop
Hope this helps.
James
#3
Posted 15 September 2005 - 04:57 PM
are some of those comments? and dont i hafta declare integers and the string answer?
PS thx a bunch
PS thx a bunch
Edited by Black_Belt_v1, 15 September 2005 - 04:58 PM.
#4
Posted 15 September 2005 - 06:47 PM
Sorry been using .NET
You would have Answer as a integer sorry about that
You would have Answer as a integer sorry about that
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users