closed by
319 views
0 votes
0 votes
closed with the note: Undefined behaviour

How does the following expression evaluate to if suppose n=2

n=2;
a[++n]=n++;

 

closed by

1 Answer

1 votes
1 votes
It has undefined behavior , depends on the compiler .

If anyhow answer is required , it might be a[3] = 3.

Related questions

0 votes
0 votes
2 answers
1
bahirNaik asked Jan 13, 2016
665 views
After executing the program, I am getting 10 as the answer.Please explain and give the postfix for the expression [ z=x++-y*b/a ].
1 votes
1 votes
2 answers
2
bahirNaik asked Dec 11, 2015
2,807 views
What is the complexity of evaluating an infix expression having n operators?
0 votes
0 votes
0 answers
3
CJ147 asked Oct 13, 2018
230 views
How does the following expression evaluate to if suppose n=2a[++n]=n++;
0 votes
0 votes
1 answer
4