C program to demonstrate the working of increment and decrement operator

//C program to demonstrate the working of increment and decrement operator:-


#include<stdio.h>
#include<conio.h>
void main()
{
int a=15;
clrscr();
printf("A=15:\n");
a++;                                                                 //Post increment
printf("A++ = %d \n",a);
++a;                                                               //Pre increment
printf("++A = %d \n",a);
a--;                                                                //Post decrement
printf("A-- = %d \n",a);
--a;                                                                //pre decrement
printf("--A = %d \n",a);
getch();
}

=============

OUTPUT:-

A=15:
A++ = 16                                                                       
++A = 17                                                                       
A-- = 16                                                                       
--A = 15        
                                                                
=============
C program to demonstrate the working of increment and decrement operator

Comments