Practic Mode : Paper-II & III On Topic : Programming in C

Que : 1 . Consider the following statements,
int i=4, j=3, k=0;
k = ++i - - -j + i++ - - -j + j++;
What will be the values of i, j and k after the statement. (Dec-2004).


1. 7, 2, 8
2. 5, 2, 10
3. 6, 2, 8
4. 4, 2, 8
Please Select Ans Options .
Explanation

Option 3 is Correct Answer.
Value of i = 4; its increment twice so it become 6.
Value of j = 3; 2 time decrement & 1 time increment so it becomes : 2.
value of k=0;
k= 5 - 2 + 5 - 1+ 2
= 9.