#include <stdio.h>
void main()
{
int array[9]={1,2,3,4,5,6,7,8,9};
int i=-1;
while (i<8)
{
printf("The Element is %d and its index is %d\n", array[i],++i);
}
}
In the above program, the loop starts with -1. But in the output , the index starts from 0 to 8. I couldn't understand the concept behind it. Can anybody explain it?