{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Ch. 8: Formatted Input and Output

Ch. 8: Formatted Input and Output - Formatted Input/Output...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Formatted Input/Output Outline Formatting Output with printf Printing Integers Escape Characters Printing Floating-Point Numbers Printing Strings and pointers Field Widths and Precisions Flags Formatting Input with scanf Sample Problem Function getnum() Extensions in Ch Default Formatted Input and Output Formatted Block of Output Using fprintf
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Formatting Output with printf Precisely formatted output is accomplished using the output function printf . The printf function has following form printf( format-control-string, arguments ); Format-control-string: Using specifications to describe output format. Each specification begins with a percent sign (%), ends with conversion specifier and is enclosed in quotation marks. arguments: correspond to each conversion specification in format- control-string.
Image of page 2