Increment Decrement Operators in C

C programming allows two very useful operators.these are the increment and decrement operators,we use the increment and decrement statements in for and while loop in c programming.

Sr.No

Operators

Descriptions

01

++

Increment

02

--

Decrement

Example


#include <stdio.h>  
void main()
{
 int x = 10,y = 20; 
 printf("Value of x : %d \n", x);
 printf("Value of x : %d \n", x++); 
 printf("Value of x : %d \n", x); 

 printf("Value of y : %d \n", y); 
 printf("Value of y : %d \n", y--); 
 printf("Value of y : %d \n", y); 
}
							
Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!