What will be big O complexity for this loop?
The inner loopnever stopped for $n \geq 1$ as for the first time i = 0 and j += i never increased the value of j. If we suppose i will be started from 1, for i = 1 the inner loop will be iterated $n$ times. for i = 2 as value of j is increased by step size 2, the number of iterations of the inner loop is $\frac{n}{2}$. Hence, the computation cost of the program is $\sum_{i = 1}^{n-1}\frac{n}{i} = n \sum_{i = 1}^{n-1}\frac{1}{i} = \Theta(n\log(n))$.