0
int i=5,j; j=i++ Ă i++; printf ("%d", j); what will be the output for this?
In C language, there is an increment operator. There is post increment and pre increment. How to use these?
1 Answer
+ 2
using the pre-increment operator, the value ist first incremented then returned. using the post increment operator, the unchanged value is returned before the value is incremented.
therefore the code returns 30 (one of both terms of the product is evaluated first, as post increment is used, the value returned is 5 before incremented to 6. 6 is returned on the seconde term before incremented to 7. 5x6 is 30)