C++ 02: Data Types and Variables
Data Types in C++
1) To store numbers without decimal points.
|
Data Type |
Memory |
|
int |
2 bytes |
|
long |
4bytes |
2) To store numbers with decimal points.
|
Data Type |
Memory |
|
float |
4 bytes |
|
double |
8bytes |
3)To store characters like alphabets and symbols.
|
Data Type |
Memory |
|
char |
1byte |
|
|
|
Variables
A memory location with specified name is called as variable. The variables are used to store the values of different data types.
Syntax:
data_type_variable_name
E.g. float x = 3.14;


Comments
Post a Comment