Initially i = 6
now when entering into the loop first “—i” or pre-decrement of i at the initialization point makes 6 to 5 and another “—i” which is at the condition point makes 5 to 4
now when entered into the loop it will give 4 as output.
now after one iteration again one decrement that is post decrement which will make i = 4 to i =3
now again come to the checking point it will make i = 3 to i =2
now enter the loop and print 2
now after the second iteration post decrement will make i = 2 to i =1
and at the checking point as pre decrement is present it will first reduce the value to 0 and the checking condition fails and terminate the loop.
and the final output will be 42.