Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Statement; j++ is invoked $n$ times (total!), and the second for-loop increments $i$ $n$ times (total!), and the outer for-loop increments $i$ only once after which it quits since $i$ reaches $n$ (by the second for-loop). This gives $n+n +1= 2n+1$ which is $O(n)$.
The inner for-loop starts from $i=0$ and runs until $i=n$.Statement; j++ is executed $n$ times for only $i=0$ and never executed for $i>0$. The outer for-loop runs only once for $i=0$. You could observe it by running this code.
In fact $O(n^3)$ is not a wrong answer, but $O(n)$ is tighter bound. Three loops does not necessary imply cubic time. Please pay attention to variables used in the for-loops. In particular, is it true that the outermost for-loop always runs $n$ times? How many times is j++ invoked?
First of all please replace the image with text (source code). Second, what is your version? Why do you think it should be $O(n^3)$ and not $O(n^)$? Please include it in your post.