C KEYWORDS – A BRIEF DESCRIPTION

C KEYWORDS - The 32 keywords in C Language

18. LONG KEYWORD

long is one of the C keywords which we use in different data types as type qualifiers. We use keyword as a type qualifier with fundamental data types such as int and double.

Certainly, long is a size qualifier which when we use with a data type increases its range and size.

Generally, when we use long size qualifier with signed int data type, it takes 4 bytes from the memory. Also, it ranges from -2147483648 to 2147483647. While, when we use it with unsigned int data type, it takes 4 bytes from the memory. And, ranges from 0 to 4294967295.

Likewise int, when we use long size qualifier with double data type, it takes 10 bytes from the memory. Also, it ranges from 3.4E-4932 to 1.1E+4932.

SYNTAX :

Keyword_name data_type variable_name;

Here, long will be the keyword name. Data type and Variable name will be of user’s choice.

EXAMPLE :

long int a;

 

19. REGISTER KEYWORD

register is one of the C keywords which we use to define Register storage class. We can use Register storage class to define local variables that should be stored in the register.

The keyword is working inside a block, but we cannot use it as a global variable. Why! Because we use this storage class for less data space.

We should use register keyword only for variables that require quick access such as counters.

SYNTAX :

Keyword_name data_type variable_name;

Here, register will be the keyword name. Data type and Variable name will be of user’s choice.

EXAMPLE :

register int a;

Here, a is a variable of integer data type which would have a maximum size equal to the register size.

 

20. RETURN KEYWORD

return is one of the C keywords which we use to return from a function. Generally, we use this keyword in return statement.

Generally, we categorise it as a jump statement. Why!? because it causes execution to return to the point at which the call to the function was made.

The return keyword may or may not have any value with it. If return has a value with it, then that value becomes the return value of the function. And if no return value is specified, then the compiler returns a garbage value.

SYNTAX :

Keyword_name expression;

Here, keyword_name is return. Expression can be any identifier or variable whose value will be the return value of the function.

NOTEThe expression will be present only if the function is declared as returning a value.

EXAMPLE :

int add( )

  int a, b, c;

  a=10, b=20;

  c=a+b;

  return c;

}

Above given is a simple user defined function add. In the function, the user is storing the sum of two variables a and b in c. Furthermore, the value of c will be the return value of of the function.

Leave a comment

Your email address will not be published. Required fields are marked *

15 thoughts on “C KEYWORDS – A BRIEF DESCRIPTION”