To all beginners. Not because it is a number, means it must be an "int"/"double"/"float" datatype. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

To all beginners. Not because it is a number, means it must be an "int"/"double"/"float" datatype.

If you are dealing with a number, and you can't decide whether you should declare it as an "integer"/"double"/"float" or a "string"/"char," Think of the usage of the number you are dealing with. Are you going to subject/use it to a mathematical computation? Like incrementing it or using it as part of a mathematical equation? If yes, make it an "int"/"double"/"float" (ex. age) If you are just going to display or output it, then declare it as a "string"/"char" (ex. House No., Tel. No., etc) #JustSharing

2nd Feb 2017, 2:52 PM
Erwin Mesias
Erwin Mesias - avatar
2 Answers
0
Read the last line.
7th Feb 2017, 4:34 AM
Erwin Mesias
Erwin Mesias - avatar
- 1
Is this a question or some lecture?
6th Feb 2017, 2:03 PM
Bhaskar M R
Bhaskar M R - avatar