Decreament operator:
-Denoted by --
-this operator are able to decrease the variable value by 1
Type:
post decreament(i--)
pre decreament(--i)
Example-
i=3;
i--;
//Now value of i is 2
--i;
//Now value of i is 1
program-
#include < stdio.h>
int main()
{
int i=10;
printf("i=%d\n",i);
i--; // i=i-1
printf("i=%d\n",i);
--i;
--i;
i--;
printf("i=%d",i);
}
output-
i=10
i=9
i=6
-In this program, we start with i=10, then print the value of i after apply decreament operator and result will show in above output.