What is a Pre-Decrement Operator?
In pre-decrement operation, the decrement operator is used as the prefix of the variable. The decrement in value happens as soon as the decrement operator is encountered.
Syntax of Pre-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