WHAT IS THE VALUE OF (i-1) FOR THE 1ST RUN OF NESTED LOOPin the following code?

int a[9]={8,7,6,9,9,6,5,55,2};
for(int i=0;i<9;i++)
{
cout<<a[i-1];
}
what will be the first value of a[i]?

Hey Aman, for first iteration it will print the value present on the address a[i-1] as i=0 and therefore it will result in a garbage value at index i-1 of array a.

Hey Aman, as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required. And please mark your doubts as resolved in your course’s “Ask Doubt” section, when your doubt is resolved.