
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Pre-increment (or pre-decrement) in C
Increment operators are used to increase the value by one while decrement works opposite increment. Decrement operator decreases the value by one.
Here is the syntax of pre-increment operator in C language,
++variable_name;
Here is the syntax of pre-decrement operator in C language,
--variable_name;
Let us see the difference between pre-increment and pre-decrement operator.
Pre-increment − Before assigning the value to the variable, the value is incremented by one.
Here is an example of pre-increment in C language,
Example
#include <stdio.h> int main() { int i = 5; printf("The pre-incremented value : %d
",i); while(++i < 10 ) printf("%d\t",i); return 0; }
Output
The pre-incremented value : 5 6789
Pre-decrement − Before assigning the value to the variable, the value is decremented by one.
Here is an example of pre-decrement in C language,
Example
#include <stdio.h> int main() { int i = 10; printf("The pre-decremented value : %d
",i); while(--i > 5 ) printf("%d\t",i); return 0; }
Output
The pre-decremented value : 10 9876
- Related Articles
- Pre-increment and Post-increment in C/C++
- Pre-increment and Post-increment concept in C/C++?
- Pre & post increment operator behavior in C, C++, Java, and C#
- Write a C program to demonstrate post increment and pre increment operators
- Increment ++ and decrement -- Operators in C++
- Increment and Decrement Operators in C#
- Increment ++ and Decrement -- Operator Overloading in C++
- What are C# pre-processor directives?
- PHP Increment/Decrement Operators
- What are increment (++) and decrement (--) operators in C#?
- What is a pre-processor directive in C#?
- What is #define pre-processor directive in C#?
- Explain the pre-processor directives in C language
- Bootstrap pre tag styling
- HTML DOM Pre Object

Advertisements