What should be the time complexity of the following code? I tried to think and come up with O(n2) but the output says it to be of O(n). Can someone please explain through code?
for(int i = 0; i < n; i++){
for(; i < n; i++){
cout << i << endl;
}
}