What is different between Data type and variable
Answers
Answered by
0
Answer: THE MEMORY REQUIRED BY THE VARIABLE IS DEFINED BY ITS DATA TYPE.
For eg.
'x' is a variable.
'int' is a data type. 'int' is the keyword for integer. Integer means number which dont have fractional part.
Now,
int x;
Variable x will require 2 bytes to get stored. Because storage REQUIRED by its data type that is int is 2 bytes.
float x;
Variable x will require 4 bytes to get stored. Because storage REQUIRED by its data type that is float is 4 bytes.
Floating point is a real number. float is a keyword used for it.
Similar questions