Working of this loop?

int main() {
int arr[] = {1,2,3,43,21};

for( int i = 1 ; i > 0 ; i-- ){
    cout << arr[i] << " ";
}

It gives Output as 2.
I want to understand how it is working and givin output as 2.

Thank you!

It is quite simple you go from 1 to 1 as next value is 0 and your loop is running only if it is greater than 0.So it will print only a[1] ie. 2

If you think that your doubt is resolved then please rate your experience