Int p= 3 p*=p++ + --p + ++p - pp--
please tell Answer fast
Answers
Answered by
1
Answer:
Answer is 72.
Explanation:
Since expressions in C are evaluated based on precedence and associativity[1].
According to that, ++(Pre-increment) has higher precedence than +(Addition), also +=(Assignment by sum) has associativity of right to left, that means first expression on right side of += will be evaluated!
We also know that pre-increment will first increment the value of variable and then evaluate it in expression, hence solving above expression step by step will result in:
1> p += p + ++p;
2> p += p + ++23;
3> p += p + 24;
4> p += (24 + 24);
5> p = p + (24 + 24);
6> p = 24 + 24 + 24;
7> p = 72;
Hence the output of above statement will be 72.
please make it brainlist
Answered by
0
Answer:
please mark as brainlist
I will thank your all answers
Similar questions