Keywords, Identifiers, Variable & Constants in C.
1 min readDec 4, 2021
what are keywords?
- keywords are predefined words. keywords have some special meaning.
- keywords are part of the syntax. they cannot be used as an identifier.
for example: int amount;
int is a keyword that indicates amount is an integer type of variable.
type of keyords:
Identifiers:
- identifiers must be unique.
- identifiers are created to give a unique names.
Example:
char name;
int balance;
C variable:
- in programming, a variable is a cantainer to hold data.
- To indicate the storage area, each variable should be given unique name.
example: int number = 20;
- number is a variable of int type, here the variable is catained integer value 20.
Constants:
if you want to define a variable whose variable cannot be changed, you can use the const keyword.
const number = 20;
- number is a symbolic constat.
- its value cannot be changed.
const pi = 3.14;
pi = 2.14; //error