| You are here: | About>Computing & Technology>C / C++ / C#> C> C Tutorials> Modifying format Specifiers |
![]() | C / C++ / C# |
Elsewhere on the WebC Tutorial Lesson Two - Handling NumbersLearn how to use Format SpecifiersFormat Specifiers can be enhanced with alignment, width and precision modifiers as -W.P W is the minimum field width in chars. P is the number of digits after the decimal point of a float, or number of digits of an int. A - means the output is left aligned, else it is right aligned.
Here are some examples. #include <stdio.h> When run, this is the output Out ......47Notes periods are spaces. Note the loss of precision with the float variable f. That completes this lesson. In lesson three, we'll start looking at chars and arrays.
<< Previous | Next Elsewhere on the Web |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | Print this Page | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


