On executing this piece of C command, the output of num is 7. I was expecting it to be 6, can anyone explain why and how it turns out to be 7?
#include <stdio.h>
int main() {
int a[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int i = 0, num = 0;
num = a[++i + a[++i]] + a[++i];
printf("%d ", i);
printf("%d ", num);
return 0;
}