c program for understanding the concept of pre decrement and post decrement
#include<stdio.h>
main()
{
int i=10,j;
j=i--; /* j value 10 , i value 11*/
/*post decrement*/
printf("\n After post-decrement: j value: %d , i value:%d \n",j,i);
j=--i; /* j value 12, i value 12*/
/*pre-decrement*/
printf("\n After pre-decrement: j value: %d, i value:%d \n",j,i);
return(0);
}
Output: ( using GNU GCC Compiler with Code Blocks IDE )
After post-decrement: j value: 10 , i value: 9
After pre-decrement: j value: 8, i value: 8
nice article .thank you.
ReplyDeleteweb programming tutorial
welookups