This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes C / C++ and the fly likes Issues in understanding the basics of the output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Issues in understanding the basics of the output" Watch "Issues in understanding the basics of the output" New topic
Author

Issues in understanding the basics of the output

Rachit Kumar Saxena
Ranch Hand

Joined: Dec 24, 2011
Posts: 50
Whenever I write:
printf("%3.1d",9);

I get:
9

but printf("%3.2d",9);

Gives:
09 as output.Why?Could anyone explain with the basics?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14918
    
  26

See the documentation for printf, which explains exactly what the format string means.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issues in understanding the basics of the output
 
It's not a secret anymore!