harish reddy

harish reddy

  • NA
  • 162
  • 33.5k

Question on datatypes

May 30 2017 10:39 AM
First example:
long value = 234L;
Console.WriteLine(value);
Q: Why should we give 234L instead of 234? Anyway the datatype is long. then why is L needed at the end of 234?
second example:
double d = 0.1f; Console.WriteLine(d);
float c = 0.1f; Console.WriteLine(c);
Q: Why is f required after 0.1 in both cases ? Main doubt is "f" is called float. Since the data type is float,Why f needs to be put after 0.1 ?

Answers (5)