Variable
Data Types
Primary Data Type
- int: It is used to declare integer variables. Ex- int total;
- char: It is used to declare character variables. Ex- char c;
- bool: It is used to declare boolean variables. A boolean variable can store either true or false. Ex- bool a;
- float: It is used to declare floating point variables. Ex- float avg;
- double: It is used to declare double precision floating point variables. Ex- double avg;
- void: It means no value. Void data type is used for functions which does not returns any value. Ex- void avg();
Derived Data Type
- Array
- Function
- Pointer
User Defined Data Type
- Structure
- Class
Data Type Modifier
The modifiers signed, unsigned, long, and short can be applied to integer types. signed and unsigned can be applied to char, and long can be applied to double.
The modifiers signed and unsigned can also be used as prefix to long or short modifiers. For example, unsigned long int.
0 Comments:
Post a Comment
If you have any queries or suggestions, please let me know!