CHAA
CHAA
•Character Set
•Identifiers and Keywords
•Data Types and Storage
•Data Type Qualifiers
•Variables
•Declaring Variables
•Initializing Variables
•Constants
•Symbolic Constants
Character Set
Every character set contains a distinct code value for each character in the basic C character
set.
Identifiers
Identifiers are the names given to various program elements such as constants, variables,
function names and arrays, etc.
Keywords
Keywords are reserved words that have standard, predefined meanings in C. They cannot be
used as program-defined identifiers.
Data Types and Storage
Variables
Variable is an identifier whose value changes from time to time during execution. It is a named
data storage location in your computer's memory.
All variables have three essential attributes:
• the name
• the value
• the memory, where the value is stored.
Declaring Variables
•Before any data can be stored in the memory, we must assign a name to these locations of
memory.
For example,
int a;
short int a, b;
Variables and Constants int c, d;
long c, f;
float r1, r2;
Initializing Variables
When variables are declared initially, values can be assigned to them in two ways:
For example,
int a = 10;
float b = 0.4 e –5;
char c = ‘a’;
Constants
•A constant is an identifier whose value can not be changed throughout the execution of a
program whereas the variable value keeps on changing.
Integer Constants
1. Decimal integer constants
2. Invalid Decimal integer Constants
3. Octal integer constants
4. Hexadecimal integer constants
5. Valid Hexadecimal integer constants are:
6. Invalid Hexadecimal integer constants are:
7. Unsigned integer constants:
8. Long Integer constants
ESCAPE SEQUENCE
•There are some non-printable characters that can be printed by preceding them with '\'
backslash character.
String Constants
•It consists of a sequence of characters enclosed within double quotes.
Symbolic Constants
Symbolic Constant is a name that substitutes for a sequence of characters or a numeric
constant, a character constant or a string constant.