C DATA TYPES AND CONSTANTS – A BRIEF DESCRIPTION

C DATATYPES AND CONSTANTS - A BRIEF DESCRIPTION
  • double data type

double data type is one of the fundamental data types which we use for storing double precision floating point number.

Generally, a double data type takes 8 bytes from the memory.

SYNTAX :

Data_type variable_name;

Here, the data_type is double and the variable_name is of user’s choice.

EXAMPLE :

double num;

double num=3.4567893;

 

  • void data type

void data type is one of the fundamental data types which explicitly declares a function as returning no value. And also, it creates generic pointers.

Generally, we do not use any modifier or type specifier preceding them.

SYNTAX :

Data_type function_name(arguments)

Here, Data_type is void. The function_name is any user-define function. Finally, the arguments are the different variables of different data types.

EXAMPLE :

void fun( )

{

 printf(“HELLO WORLD”);

}

Here, the Data_type void represents that the function doesn’t return anything. The output of the above program is,

HELLO WORLD

 

MODIFIERS OR TYPE SPECIFIERS :

Generally, we can use Modifiers or type specifiers with the fundamental data types to get some more types. Except for data type void, the fundamental data types may have various modifiers or type specifiers preceding them.

Certainly, we use a modifier or type specifier for a specific reason. It alters the meaning of the base data types to fit various situations more precisely.

We can use the following modifiers or type specifiers..

  1. Size qualifiers – SHORT, LONG
  2. Sign qualifiers – SIGNED, UNSIGNED

Furthermore, when we use qualifier unsigned, the number is always positive. On the other side, when we use qualifier signed the number may be positive or negative.

Size and Range of different data types - C DATA TYPES
http://www.allaboutcomputing.net

The above picture represents the size and range of different data types with type specifiers with their format.

Leave a comment

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

8 thoughts on “C DATA TYPES AND CONSTANTS – A BRIEF DESCRIPTION”