0

How this expression works......

int a=0 int b[3] ={1,2,3}; int c = ++b[++a] + ++a + b[--a] ; printf ("%d", c) ; OUTPUT : 8

3rd Apr 2020, 10:10 AM
Muralikrishnan
Muralikrishnan - avatar
2 Respostas
+ 3
int a=0; int b[3] ={1,2,3}; int c = ++b[++a] + ++a + b[--a]; Here ++a = 1; And next ++a will be 2 And next --a will be 1 from the b array b[1] = 2 So c = ++b[1] + 2 + b[1] Here ++b[1] = 3 and b[1] = 3 because first increment the value by 1 then again assign to b[1] So c = 3 + 2 + 3 = 8
3rd Apr 2020, 10:51 AM
A͢J
A͢J - avatar