cant fix the problem!!!!

hey guys. this is the code ive got so far but the thing is when i input 10+ it displays 123456789101112 ...
but the output should be 123456789012...
how do i fix this problem?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 #include <iostream>
using namespace std;

int main()
{
 int i, j,n;

 cin >> n;
 cout << endl;

 for (i = 1 ; i <= n ; i++)
 {
    cout << " ";
    for (j = 1 ; j <= i; j++)
    {
       cout <<j;
    }
 cout<< endl;
 }

 cout << endl << endl << endl;
 system("PAUSE");
 return 0;
}

cout << j%10;?
lol
thank you so much
Topic archived. No new replies allowed.