The decrement operator: -- : Increment decrement Operator « Operator « C Tutorial






#include <stdio.h>
#include <stdlib.h>
 
int main()
{
    char weight[4];
    int w;
 
    printf("Enter your weight:");
    gets(weight);
    w=atoi(weight);
 
    printf("Here is what you weigh now: %i\n",w);
    w--;
    printf("w++: %i\n",w);
    w--;
    printf("w++: %i\n",w);

    return(0);
}
Enter your weight:123
      Here is what you weigh now: 123
      w++: 122
      w++: 121








5.3.Increment decrement Operator
5.3.1.Increment operator
5.3.2.The decrement operator: --