Escape Sequences

ARTHEESWARI . S
2 min readMar 25, 2022

The printf() and scanf() statements follow a combination of characters of characters called as escape sequences. Escape sequence are special characters starting with ‘\’ (backslash).They are used to break the normal sequence of a computer.

Notice that the characters \n were not printed on the screen. The backslash(\) is called an escape character.

Escape Sequence

\n →New line

\b →Backspace

\f →form feed

\’ →single quote

\\ →backslash

\0 →Null

\t →Horizontal Tab

\r →Carriage Return

\a →Alter(Bell)

\” →Double quote

\v →Vertical tab

\? →Question Mark

\000 →Octal number

\xhh →Hexadecimal number

DECLARING VARIABLES:

The declaration of variable should be done in the declaration part of the program. The variable must be declared before they are used in the program. Declaration provide two things:

(1) Compiler obtains the variable name

(2) It tells the compiler about the data type of variable being declared and helps in allocating the memory.

SYNTAX

Data_type variable_name;

Example:

int a,b;

char m;

float s;

double k;

The int, char, float, and double are keywords to represent data type. Commas separate the variable , if variable are more than one.

Data Type →Keyword

Character → char

Signed character → signed char

Unsigned character → unsigned char

Integer → int

Signed integer → signed int

unsigned integer →unsigned int

Floating point → float

Double Floating point → double

Extended double floating point → long double

--

--