1. ## Multiplication Table Error

Hello,

I am trying to make a multiplication table that goes up to 10 X 10 = 100. I am a newbie in C++ and this is probably a really stupid error.

Code:
```  #include <iostream.h>

int main()
{
int num = 1;
int num1 = 1;
int num2 = 2;
int num3 = 3;
int num4 = 4;
int num5 = 5;
int num6 = 6;
int num7 = 7;
int num8 = 8;
int num9 = 9;
int num10 = 10;

do
{
num1 = num++;

if ( num1 < 10)
cout << "00" << num1 << " ";
if ( ( num1 >= 10 ) & ( num1 < 100 ) )
cout << "0" << num1 << " ";
}
while ( num1 != 10 );

cout << endl;

num = 1;

do
{
num2 = num2 * num++;

if ( num2 < 10)
cout << "00" << num2 << " ";
if ( ( num2 >= 10 ) && ( num2 < 100 ) )
cout << "0" << num2 << " ";
}
while ( num2 != 20 );

return 0;
}```
This displays alot of 000's.
Can you please explain to me what i did wrong?
Thanks in advance to all those who help me.

2. Are you trying to make a mult. table like 10 * 1, 10 * 2, etc. to 10 *10? If you are think about which number is changing or increasing and how much is it increasing. Then use a for statement.

3. Code:
```num = 1;

do
{
num2 = num2 * num++;

if ( num2 < 10)
cout << "00" << num2 << " ";
if ( ( num2 >= 10 ) && ( num2 < 100 ) )
cout << "0" << num2 << " ";
}  while ( num2 != 20 );```
Here things go wrong.

Code:
```num    num2    (num2 = num2 * num++)
1         2           2
2         2           4
3         4           12
4         12         48```
So num2 will never become 20.

4. Hmm, you actually just need two do//while statements and two counters to solve this problem.

....
....
int num = 0;
int num1 = 0;
do
{
//Increase "left" number by one
num++;
do
{
//Increase "right" number by one
num1++;
cout << num << " * " << num1 << " = " << (num*num1) << endl;
}while ( num1 != 10 );
//When num1 has reached 10 then set it to 0 again
num1 = 0;
cout << endl;
}while ( num != 10 );
....

You can even use for-loops to achive the same result, its even better(shorter).