I am not able to understand why both values are different and how does it change?
int a[100]
for(int i=0; i<100; i++)
cin >> a[i];
int i=20;
cout << a[i+1] << endl;
cout << a[i]++;
I tried to know value of both
>Solution :
a[i+1] that means value of i+1th index. which means, lets suppose if i=20 and it has value of 50 and a[21] has value of 200 then a[i+1] means a[i+1]=200
so when it’s about a[i+1] then it point to the next
and a[i]++ that means increase 1 by ith index value.
so i=20 and a[i]=50 and a[i]++ means 50+1 which is 51