time complexity questions

what are the time complexities in these two cases, big O notation.

1. Code:

`int a =3;`

while (a <= n)

a = a*a;

2. Code:

`public void foo (int n, int m)`

{

int i = m;

while (i > 100)

i = i/3;

for (int k=i ; k>=0; k--)

{

for (int j=1; j<n; j*=2)

System.out.print(k + "\t" + j);

System.out.println();

}

}

for number 1, I would guess it would have something to do with log(_3)n

and the second one i'm just confused. although the general rule is that with two loops is O(n^2), but i'm assuming they're tricking us here...