Saturday, January 23, 2010

Lparts

#include< stdio.h >
main()
{
int a=1,b;
b=a++*2;
printf("%d %d",a,b);
}




Output:

2 2

How it works?
we use post increment so increment operation of 'a' will be done after multiplication . so b=2. then a value will be incremented so a=2

0 comments:

Post a Comment