C DATA TYPES AND CONSTANTS – A BRIEF DESCRIPTION

C DATATYPES AND CONSTANTS - A BRIEF DESCRIPTION

C DATA TYPES AND CONSTANTS – A BRIEF DESCRIPTION

C DATA TYPES –

Generally, C Language supports different types of data. Also, the Storage representation of C DATA TYPES is different in memory. Furthermore, talking about C DATA TYPES..

C DATA_TYPE is a classification of data which tells compiler about the interpretation and use of data by the user.

Generally, we can classify C DATA TYPES on two types that are,

  1. FUNDAMENTAL DATA TYPES
  2. DERIVED DATA TYPES

1. FUNDAMENTAL DATA TYPES

Certainly, the C data types which are already present in the C subset are Fundamental data types. These are the data types which are already present and exists in the C library. That means a user can’t change their meaning.

Generally, there are five atomic C data types in C Language. They are as following,

  • int
  • char
  • float
  • double
  • void

Above are the 5 fundamental C DATA TYPES. Also, each and every of them has a specific purpose. Given below are the specifications for each of the Fundamental data types..

  • int data type

int data type is one of the fundamental data types which we use to store integer values.

Generally, an int data type takes 2 bytes from the memory.

SYNTAX :

Data_type variable_name;

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

EXAMPLE :

int a;

int marks=10;

 

  • char data type

char data type is one of the fundamental data types which we use to store any single character.

Generally, a char data type takes 1 byte from the memory.

SYNTAX :

Data_type variable_name;

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

EXAMPLE :

char b;

char grade=’A’;

 

  • float data type

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

Generally, a float data type takes 4 bytes from the memory.

SYNTAX :

Data_type variable_name;

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

EXAMPLE :

float c;

float avg=20.03;

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”