Home > Interview Questions > C#.NET > whats the difference between a++ and ++a in C#?

whats the difference between a++ and ++a in C#?

by Thamil   on 14/10/2014   Category: C#.NET   |  Level: Intermediate   |  Views: 4518    |  Points: 25     |  Gold 


The post increment operator (a++) would add one to a and return the old value.
The pre increment operator (++a) would add one to a and return the new value.

  int i=1;
Response.Write(++i);
i = 1;
Response.Write(i++);
Response.End();



« drordown list with filtered multiple checkboxs
» You cannot create an instance of an abstract class. So, what is the use of a constructor in an abstract class?
Post Question  |  Question Home

Recent Posts

User Responses


No response found, be the first to review this question.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts