Constants in C

Post on 13-Dec-2014

20 views 4 download

description

Constants in C For S-Teacher

transcript

Identifiers: Identifiers are user defined names of

variables, functions and arrays.Lower case is commonly used.Constants :

Constants have fixed values that don’t change during execution of a program.

constants are of two types:1.Numeric constants2.character constants

Identifiers and Constants

Constants

Backslash character constants:Each one represents one character although it

consists of two characters.These character combination are known as escape

sequence which are used in output functions.‘\a’ audible alert.There are 12 escape sequence characters:

Some of them are,1.’\b’ – backspace2.’\f’ – form feed

Escape Sequences

BACKSLASH CHARACTERS ARE,1. ‘\a’ Audible alert (bell)2. ‘\b’ Back space3. ‘/f’ Form feed4. ‘/n’ New line5. ‘/r’ Carriage return6. ‘/t’ Horizontal tab7. ‘/v’ Vertical tab8. ‘/’ Single quote9. “/” Double quote10. ‘/?’ Question mark11. ‘//’ Back slash12. ‘/0’ Null