What is the difference between the prefix and postfix forms of the ++ operator

The prefix form performs the increment operation and returns the value of the incrementoperation. The postfix form returns the current value all of the expression and thenperforms the increment operation on that value.

Showing Answers 1 - 1 of 1 Answers

amna

  • Aug 20th, 2011
 

into prefix
x=1;
y=++x;
it means that we assign 2 to y bcoz first it increments the value of x then assign it.
vice versa for post fix.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions