Hello.I am having trouble of understanding why this codes outputs these numbers: 9,1,9,3,8,5. Can someone please explain how the program works?
Code:
:

#include <stdio.h>
#include <stdlib.h>


int main()
{
int arr[6]={9,7,9,8,8,9};
int i=-1;
while(i<5){
    i=i+2;
    arr[i]=i;
}
for(i=0;i<6;i++){
    printf("%d, ",arr[i]);
}
return 0;
}