Explanation:

     The prototype for printf as per ANSI C is:

*int printf( const char *format,…)*

the return value is integer and returns the number of characters
successfully read by printf.

Also,in case of printf(),the evaluation of expressions passed on as
arguments is done from right to left on stack and then printed from
left to right by popping the stack.

So,the output comes as:

c :Evaluation of printf("%c\n",b).Note that after execution,they
return the number of characters read.

10000:  Evaluation of  printf("%d\n",a)

6,2 :No of characters read printed from left to right as printf now is:

printf("%d %d",6,2);

@Divya:Good question for clearing concepts related to printf.May i know the
source?





On Fri, Jun 11, 2010 at 9:26 AM, Rohit Saraf <rohit.kumar.sa...@gmail.com>wrote:

> c
> 10000
> 6,2
>
> u might be expecting 5,1 if u are forgetting the newline character :)
> --------------------------------------------------
> Rohit Saraf
> Second Year Undergraduate,
> Dept. of Computer Science and Engineering
> IIT Bombay
> http://www.cse.iitb.ac.in/~rohitfeb14<http://www.cse.iitb.ac.in/%7Erohitfeb14>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algoge...@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
ASHISH KUMAR JAIN
Engineer,P & T
CIENA,Gurgaon
Contacts:
Phone:- +919899668402
e-mail:
         ashish.jain.cs...@itbhu.ac.in
         akjlucky4...@gmail.com
         asj...@ciena.com

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

Reply via email to