IN second program:
 in function value are always push in the stack from left.
so first value is --i that will make i=1 and pass to function
and
after that i++ will be passed.that's means i will be passed and after that
value will be incremented.
so 1 will pass and after passing value. i will changed to 2.


if u wnat to know why reverse order than can go through:

http://cs.nyu.edu/courses/fall03/V22.0201-003/c_param.html
-----------------------------------------
PRAMENDRA RATHI
NIT ALLAHABAD




On Sat, Jun 11, 2011 at 7:28 PM, Vishal Thanki <[email protected]>wrote:

> In 1st program, 2nd printf requires one more argument. And basically
> %a is used for printing a double value in hex. see "man 3 printf".
>
> On Sat, Jun 11, 2011 at 5:29 PM, nicks <[email protected]> wrote:
> > Hello friends..plz help me in understanding the following C Output
> >
> > first one is --
> >
> > #include<stdio.h>
> > #include<conio.h>
> > main()
> > {
> > int a=5;
> > printf("a=%d\n",a);
> > printf("%a=%d",a);
> > getch();
> > }
> > OUTPUT -
> > a=5
> > 0x1.2ff380p-1021=4199082
> >
> >
> > and the other one is --
> >
> > #include<stdio.H>
> > # include <conio.h>
> > int i=2;
> > main()
> > {
> >  void add();
> >  add(i++,--i);
> >     printf("\ni=%d \n",i);system("pause");
> > }
> > void add(int a ,int b)
> > {
> >  printf("\na=%d b=%d",a,b);
> > }
> >
> >  OUTPUT -
> > a=1 b=1
> > i=2
> >
> > --
> > 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.
>
>

-- 
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