Monday, 8 December 2014

simple C program to observe differences between pre-increment and post-increment operations
#include<stdio.h>
main()
{
int a=10,b=20,c=30;
printf("a=%d b=%d c=%d\n",a,b,c);
a=++b,b=c++,b+c;
printf("a=%d b=%d c=%d\n",a,b,c);
}
OutPut:
madan@madan-Lenovo-G570:~/madan$ cc ex32.c
madan@madan-Lenovo-G570:~/madan$ ./a.out
a=10 b=20 c=30
a=21 b=30 c=31