Variables and Keywords in C

Variables and Keywords in C

Variables in C

rn
rn

In a typical C program we have to do a lot of computation. Of course there will be storing of some data in different locations of memory in computer. These memory locations are identified by their address like 56234. Suppose if programmer wants to access the particular locations like 10 times in a program to store another value at that location.

rn

So It will become a tedious job for a programmer if he has to memorize the numerical address name. So to make this job easy we use variables.

rn

So variables are nothing but the name of the locations or addresses of memory which is given by programmer. A variable is an entity that may change.

rn

 

rn
rn

Keywords in C

rn
rn
Keywords are the words whose meaning is already explained to the compiler. They cannot be used as a variable name.
rn

A question which may arise in your mind that, how the computer will know that its integer variable or character variable or anything else?

rn

 There are 32 keywords used in C language.

rn

Consider an example below:

rn
int age;rnfloat height;
rn

Here, int is a keyword which declares age as a variable of integer data type.

rn

Similarly, float is also a keyword which declares height is a variable of floating integer data type.

rn

 

rn