954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Could someone explain the output for this statement

I came across these to statements and i am not sure how they are parsed
and the output given is produced...

printf("%d",printf("%d %d",5,5)&printf("%d %d",7,7));


o/p : 5 5 7 7 3

printf(" %d %d",printf("%d %d",7,7),printf("%d %d",5,5));


o/p : 5 5 7 7 3 3

Could some one explain where the two 3 's r obtained from.
They r not random , i think its got something to do with the length of the output
but not sure.

deepak_1706
Newbie Poster
7 posts since Oct 2010
Reputation Points: 10
Solved Threads: 0
 

Check following link for help on printf .
On success, the total number of characters written is returned.

Hyperion
Light Poster
42 posts since Jun 2007
Reputation Points: 11
Solved Threads: 5
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: