A data type is a type of data. More specific definition of data type is “ A data type is a data storage format that can contain a specific type or range of values”. When computer programs store data in variables, each variable must be assigned a specific data type. The data type defines the following terms in a programming language:- 1. The amount of storage allocated to variables. 2. The values that they can accept. 3. The operations that can be performed on variables 4. Data type determines how much storage space is allocated to variables. 5. Data type determines the permissible operations on variables. 6. The variables should be declared by specifying the data type. 7. There is a family of integer data types and floating-point data types. 8. Characters are stored internally as integers 9. Characters are interpreted according to the character set. Types of data types :? Integer Type: Integers are whole numbers with a machine dependent range of values. A good programming language supports the programmer by giving a control on a range of numbers and storage space. C has 3 classes of integer storage namely short int, int and long int. All of these data types have signed and unsigned forms. A short int requires half the space than normal integer values. Unsigned numbers are always positive and consume all the bits for the magnitude of the number. The long and unsigned integers are used to declare a longer range of values. Floating Point Types: Floating point number represents a real number with 6 digits precision. Floating point numbers are denoted by the keyword float. When the accuracy of the floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision. To extend the precision further we can use long double which consumes 80 bits of memory space. Void Type : Using void data type, we can specify the type of a function. It is a good practice to avoid functions that does not return any values to the calling function. Character Type : A single character can be defined as a defined as a character type of data. Characters are usually stored in 8 bits of internal storage. The qualifier signed or unsigned can be explicitly applied to char. While unsigned characters have values between 0 and 255, signed characters have values from –128 to 127. Bansal Academy is the best coaching institute for CSIR UGC NET Coaching in Chandigarh .Here you can also get coaching for GATE,Medical,Non Medical as well as for UGC NET Life Science Coaching in chandigarh. Get fast updates of Govt jobs in India under various Governemnt department.
Related Articles -
programming, data type, data,
|