O/P=9 and 49
since i++ * i++ and++ is postincrement so 3*3=9 then both i++ * i++ goes to
4and 5
now i=5.

then for ++i*++i and ++ is preincrement so first it will 6 and 7 and then
7*7=49


Vijay..............

On Mon, Jul 25, 2011 at 8:22 PM, Arshad Alam <[email protected]> wrote:

> what would be the output of the below program give little explanations
>
> #include<conio.h>
> #include<stdio.h>
> #define PRODUCT(x) (x*x)
> void main()
> {
>     int i=3,j,k;
>     j=PRODUCT(i++);
>     k=PRODUCT(++i);
>     printf("\n%d %d",j,k);
>     getch();
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to