{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSE 1310 -- Lec 9 - Input Output Input/output opearations...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Input / Output Input/output opearations are performed using input/output functinos Common input/output functions are provided as part of C's standard input/output library. To access it: #include<stdio.h> printf Function printf(“The area is %d.\n”, area); The printf function is called in order to display program output Inside the parenthesis are the functions arguments . The arguments of printf include a format string (given in quotes) followed by a print list . If the variable area has a value of 24, above function call displays the line: The area is 24 printf Function format string The first argument to printf is a format string. It must be enclosed in quotes. Most of the format string is displayed literally on the output. The format .... printf Function Placeholders in Format Strings Different conversion characters are used in placeholders for different variable types: %c char %d int %f double (used with printf) %lf double (used with scanf) %e double, to print in scientific notation %E double, to print in scientific notation
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}