What is a Post-Decrement Operator?
In post-decrement operation, the value is decremented after all the other operations are performed i.e. all the other operators are evaluated. The decrement operator is used as the suffix to the variable name.
Syntax of Post-Decrement
variable_name--
Pre and Post Decrement Operator in Programming
Pre-decrement and post-decrement are the two ways of using the decrement operator to decrement the value of a variable by 1. They can be used with numeric data type values such as int, float, double, etc. Pre-decrement and Post-decrement perform similar tasks with minor distinctions.
Table of Content
- What is a Pre-Decrement Operator?
- What is a Post-Decrement Operator?
- Pre and Post Decrement Operator in C
- Pre and Post Decrement Operator in C++
- Pre and Post Decrement Operator in Java
- Pre and Post Decrement Operator in Python
- Pre and Post Decrement Operator in C#
- Pre and Post Decrement Operator in Javascript
- Application of Pre and Post-Decrement Operators