See we analyse this as :
When i = 1 , j is incremented in steps of 1 as j = j + i and i = 1 for 1st iteration..
So j as clear from the program runs from 1 to n and increment is done by 1 in each inner loop..
So number of times the inner loop runs = n for i = 1
Similarly for i = 2 , inner loop runs n/2 times as j = j + 2 for i = 2..
Similarly for i = 3 , inner loop runs n/3 times as j = j + 3 for i = 3..
and so on till i = n-1
So time complexity = n + n/2 + n/3 + n/4...................
= n(1 + 1/2 + 1/3 ..........)
Now the series written inside the brackets is a harmonic series ..So addition formula is not there..However we can approximate by doing the integration of 1/n w.r.t n which gives us logn..
So time complexity = O(nlogn)