write a C program to show the increment and decrement operators uses…
/* Increment and decrement operations */
#include<stdio.h>
void main()
{
int a,b,c;
a = b = c = 0 ;
printf( ” Initial value of a,b,c %d %d %d \n”, a,b,c);
a = ++b + ++c;
printf( ” a = ++b + ++c =%d %d %d\n”,a,b,c);
a =b++ + c++;
printf(” a =b++ + c++ =%d %d %d\n”,a,b,c);
a = ++b + c++;
printf(” a = ++b +c++ =%d %d %d\n”,a,b,c);
a =b– + c–;
printf(” a =b– + c– =%d %d %d\n”,a,b,c);
}
run
Initial value of a,b,c 0 0 0
a = ++b + ++c =2 1 1
a =b++ + c++ =2 2 2
a = ++b +c++ =5 3 3
a =b– + c– =6 2 2