What is the data types ?
Data types are the building blocks of data structures.
C language has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location. The value of a variable can be changed any time.
1- The basic data types in c language:-
* int ( for storing whole numbers - or integers)
* float
( both for storing numbers with decimal precision - real or floating point numbers )
* double
* char ( for storing symbols – characters)
1- int - data type
int: is used to define integer numbers.
Example:
{
int Count;
Count = 5;
}
2- float - data type
float: is used to define floating point numbers.
Example:
{
float Miles;
Miles = 5.6;
}
3- double - data type
double: is used to define BIG floating point numbers. It reserves twice the storage for the number. On PCs this is likely to be 8 bytes.
Example:
{
double Atoms;
Atoms = 2500000;
}
4- char - data type
char: is used to defines characters.
Example:
{
char Letter;
Letter = 'x';
}
2- The other data types in c language:-
* signed char
* unsigned char
* short signed int
* short unsigned int
* long signed int
* long unsigned int
Data types are the building blocks of data structures.
C language has a concept of 'data types' which are used to define a variable before its use. The definition of a variable will assign storage for the variable and define the type of data that will be held in the location. The value of a variable can be changed any time.
1- The basic data types in c language:-
* int ( for storing whole numbers - or integers)
* float
( both for storing numbers with decimal precision - real or floating point numbers )
* double
* char ( for storing symbols – characters)
1- int - data type
int: is used to define integer numbers.
Example:
{
int Count;
Count = 5;
}
2- float - data type
float: is used to define floating point numbers.
Example:
{
float Miles;
Miles = 5.6;
}
3- double - data type
double: is used to define BIG floating point numbers. It reserves twice the storage for the number. On PCs this is likely to be 8 bytes.
Example:
{
double Atoms;
Atoms = 2500000;
}
4- char - data type
char: is used to defines characters.
Example:
{
char Letter;
Letter = 'x';
}
2- The other data types in c language:-
* signed char
* unsigned char
* short signed int
* short unsigned int
* long signed int
* long unsigned int