Data Type in Data Structures Using C and C++
Introduction to Data Structure
Data Type :-
Data can be of different types, therefore, same type of data can be grouped to form a separate group. In files data can be numeric, alphabetical or alphanumeric.Numeric data can be used for calculations. There can be more properties of each type. Therefore,a data type refers to a named group of data which share similar properties or characteristics and which have common behaviour among them.
For instance,Name can be contain alphabets, its data type is alphabetic; Address can contain digits (numbers) and alphabets, its data type is alphanumeric; Age can only have digits, its data type is numeric. Three fundamental data type are given below : -
1. Integer :- It allows to only have digits (0-9) and+,- signs in the integer data i.e. numbers without fractions. Example : +17,-23,54 etc .
2. Real :-
It allow to store fractional numbers i.e. , digits (0-9) along with +,-,. (dot) symbols. Example : 13.10,+17.591,-19.2201.It is two types : float and double. The float data type is used to store real numbers with less precision (i.e., digits after decimal) and the double data type is used to store real numbers with more provision.
3. Character (char):-
It allows to store any character i.e., numbers (0-9), alphabets (A-Z, a-z ) and special characters like +,-,#,$,^,~. Example - 'A, 'z', '#','$' etc.
Thank You
Comments
Post a Comment
Hello Friends,