What is the output for --(decrement) Operator? - C Operator

C examples for Operator:Increment Decrement Operator

Description

What is the output for --(decrement) Operator?

Demo Code

#include <stdio.h> 
int main() /*from  www  .  jav  a  2s .  c  o m*/
{ 
   int x = 1;  
   int y = 1; 

   x = y-- * 4; 

   printf("\nThe value of x is %d\n", x); 
   y = 1; //reset variable value for demonstration purposes 
   x = --y * 4; 
   printf("\nThe value of x is now %d\n", x); 
}

Result


Related Tutorials