0

Hii my question is how do we decide when to use which type of datatype
For eg in some program
we get int i, whereas in some programs it is float i, whereas in other programs it is double i....so how do we know which datatype to use...I am confused between int....long ...double.???

4
Contributors
3
Replies
5
Views
6 Years
Discussion Span
Last Post by D.M.
0

Hi mate

choosing ur data type is mostly depends on the value or data that the variable holds. every data type got certain range for it if the value of the variable exceeds the range it returns some garbage.

Hii my question is how do we decide when to use which type of datatype
For eg in some program
we get int i, whereas in some programs it is float i, whereas in other programs it is double i....so how do we know which datatype to use...I am confused between int....long ...double.???

0

int is used when the number is between 32,000 and -32,000.
float is used when the number involves decimal point.
double is used for larger numbers..eg.1000000000000000000

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.