Need some help with loop descriptions.

I've been trying to figure out what is going on within these two loops? Assuming all variables were of type int, can anyone describe what is happening? I ran them both but am not sure how the answers were calculated.

1
2
3
4
5
6
7
8
9
10
11
12
13
	
i =1;
while (i*i < 10)
{
    j = i;
    while (j*j < 100)
    {
        cout << i + j << endl;
        j *= 2;
    }
    i++;
}
cout << ā€œ\n*****\nā€;




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
i = 0;
do
{
    j = i * i * i;
    cout << i;
    do
    {
        k = i + 2 * j;
        cout << j << k;
        j += 2;
    }
    while (k <= 10);
    cout << endl;
    i++;
} while (j <= 5);



Topic archived. No new replies allowed.