There are two types of Increment operator:
(1) Postfix Increment operator
(2) Prefix Increment operator
It is use to increment value of variable one by one.
Syntax
variableName++
NOTE: In above program you have read b = a++;.In this statement value of a first assign to b then increment a.
In above program you have read c = a++ + b++;.In this statement value of a and value of b first add then result assign to c after assignment value of a and value of b will be increment.
In above program you have read printf("value of a = %d",a++);. In this statement first value of a will be display on output screen then value of a will be increment.
It is also used to increment value of variable one by one.
Syntax
++variableName;
In above program you have read b = ++a;.In this statement value of a first increment then assign to b.
In above program you have read c = ++a + ++b;.In this statement value of a and value of b first increment then add. After addition result will be assign to c.
In above program you have read printf("value of a = %d",++a);. In this statement first value of a will be increment then display on output screen.
Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.
Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.
comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.
comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.
copyright © 2023