Input and Output

(a) Describe briefly the field width specifier.

The number of columns used to display a value on the screen is called field width. A field width specifier describes the number of columns that should be used to print a value. It determines how the value will be displayed on the screen.

The syntax of using field width specifiers is as follows:

flag width.precision
width It specifies total number of columns used to display value.
Precision It indicates number of columns used after decimal point.

(b) What are escape sequences?

Escape sequence are special characters used in format string to modify the format of output. These characters are not displayed in the output. These characters always begin with backslash “\” . The backslash is known as escape character.

Different escape sequences used in C language are as follows:
\b Backspace
\f Form feed
\n New line
\r Carriage return
\t Tab
\’ Single quote
\” Double quote