C KEYWORDS – A BRIEF DESCRIPTION

C KEYWORDS - The 32 keywords in C Language

21. SHORT KEYWORD

short is one of the C keywords which we use as a modifier or type qualifier. Generally, we use this keyword for altering the meaning of the base type to fit various situations more precisely.

Furthermore, short is a modifier or type qualifier which we can apply to integer base types.

Generally, a short int data type takes 1 byte from the memory and ranges from -128 to 127.

SYNTAX :

Keyword_name data_type variable_name;

Here, keyword_name is short. The data_type is usually integer data type i.e. int. And the Variable_name depends upon user’s choice.

EXAMPLE :

short int num;

 

22. SIGNED KEYWORD

signed is one of the C keywords which we use in type qualifiers with different data types. It is one of the Sign qualifiers which when the user uses the number may be either positive or negative. If the user doesn’t mention sign qualifier, then the compiler assumes signed qualifier  by default.

Generally, the range of Values for signed data types is less than that of unsigned type. WHY!? Because in Signed type, we use the the leftmost bit to represent the Sign. But in unsigned type, we use this particular bit to represent the value.

Furthermore, a signed int generally takes 2 bytes from the memory and ranges from -32768 to 32767. Also, we can use this keyword with integer i.e. int and character i.e. char data type.

SYNTAX :

Keyword_name data_type variable_name;

Here, keyword_name is signed. The data_type is usually integer data type i.e. int or Character data type i.e. char. And the Variable_name depends upon user’s choice.

EXAMPLE :

signed int num;

signed char grade;

 

23. SIZEOF KEYWORD

sizeof is one of the C keywords which we use for calculating the size of operands in terms of bytes. Generally, sizeof is an unary operator i.e. it works on single operand.

Furthermore, we use this operator for making portable programs. That means the programs that can be run on different machines.

SYNTAX :

Keyword_name(data_type or Variable)

Here, keyword_name is sizeof. The data_type or Variable usually depends upon user’s choice that may be integer, Character, float, double data type i.e. int, char, float, double. 

EXAMPLE :

main( )

{

  int num;

  printf (“THE SIZE OF INT=%d”, sizeof(int));

  printf(“THE SIZE OF NUMBER=%d”, sizeof(num));

}

OUTPUT

THE SIZE OF INT=2 THE SIZE OF NUMBER=2

NOTEThe operator can be a variable, constant or any data type.

Leave a comment

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

15 thoughts on “C KEYWORDS – A BRIEF DESCRIPTION”