-
Help with math tables
Hi guys,
I have a project at college to write a program that will produce a mathamatics table, for example: -
user will input the times table number ie, 5
and also the user will input the amount of lines, ie 3,
so the result will be: -
1 x 5 = 5
2 x 5 = 10
3 x 5 = 15
I dont want you to write the program for me, but some pointers of what to do would be most helpfull....
Maybe a tutorial or something...
Thanks alot guys
Boontune
-
Well you're definately going to need a loop, probaly one that might look something like this:
for(x=0;x<=number_of_lines;x++)
I hope that helps you get started, if not say so.
-
Cheers for getting back to me,
would x be the times table number or would i assign the
times table number to x?
-
No you'd need to have another variable with the number who's times table you want. Remeber this though, every time you go through the loop x will increase by one so if it's 3 times and I used this loop it would look like this:
Code:
int numberOfLines = 5
int x;
int number;
for(x=0;i<=numberOfLines;x++)
{
cout << x;
}
would output this:
0
1
2
3
4
5
Now, what do yo uwant to do with that?
-
Yippeeeee, got it!
Cant thank you enough mate!
its been driving me mad for ages
Cheers
Boontune