There are two types of Decrement Operator:
(1) Postfix decrement operator
(2) Prefix decrement operator
It is use to decrement value of variable one by one.
Syntax
variableName--
In above program you have read b = a--;.In this statement value of a first assign to b then decrement 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 decrement.
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 decrement.
It is also used to decrement value of variable one by one.
Syntax
--variableName;
In above program you have read b = --a;. In this statement value of a first decrement then assign to b.
In above program you have read c = --a + --b;.In this statement value of a and value of b first decrement 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 decrement 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