Are the following loops $O(n^2)$ complexity
It's quite easy, you just have to write down the first terms :

1.) The print instruction will be called $n$ times, then $n/2$ times, then $n/4$ times, etc...
Finally, the number of calls to print is $\Sigma_{i=0}^{\log n} \frac{n}{2^i} = n \Sigma_{i=0}^{\log n} \frac{1}{2^i} = n \frac{1-1/2^{\log n}}{1-1/2}=\mathcal{O}(n)$.

2.) The print instruction will be called $n$ times, then $n/2$ times, then $n/3$ times, etc...
Finally, the number of calls is $\Sigma_{i=1}^{n} \frac{n}{i} = n \Sigma_{i=0}^n \frac{1}{i} = \mathcal{O}(n \log n)$.