Data Type represent the type of data stored in variable.There are four basic type of data type is used in C language such as:
- Character Data Type
- Character data represent a single data.It is used to store 1 byte of data."char" keyword is used to represent character data type.It can store number and character both.Syntax : char variable name;Example : char a ; // here a is character type of data.
- Integer Data Type
- Integer represent number data type.Numbers are non decimal such as 243,34,10 etc.Decimal number are not stored in integer data type.It can store 2 byte of data."int" keyword is used to represent integer data type.Its range is between -32767 to +32767.Syntax : int variable name;Example : int i ; // here i is integer type of data.Integer data type is sub divided into short integer , long integer , signed integer.Shorter Integer :It can store small integer.Its range between -128 to +127.
Long Integer :It can store large integer.Its range between -2147483648 to +2147483647. - Float Data Type
- It represent floating point numbers (Decimal numbers).4 byte of memory is used to store floating number.Floating point numbers are real numbers and exponent number.It range is between -3.4x1038 to 3.4x38."float" keyword is used to represent float data type.Syntax : float variable name;Example : float i ; // here i is decimal type of data.
- Double Data Type
- Double data type is used to store data which have large magnitude. It is used to store floating numbers.8 byte of memory is used to store data."double" keyword is used to represent double datatype.Its range is between -1.7x10308 to 1.7x10308Syntax : double variable name;Example : double i ; // here i is integer type of data.
No comments:
Post a Comment