Noob Question | Sololearn: Learn to code for FREE!


Noob Question

In challange question Which of the data types takes a number.. Why is string not an answer?

9/9/2020 5:48:03 AM

Abhinav Krishnan TK

3 Answers

New Answer


I'm not sure what programming language this relates to but short, int, long, float, double are common numeric data types in a few languages. string is best for text. Converting a string to an int or double takes time and it might not be possible to convert. What number does "Hello" represent? Aside from NaN(Not a number), nearly every value if not all values in a short, int, long, float, or double are valid numbers.



Abhinav, the types in the previous answer work for c# then. c# has short, int, long, float, and double.