What data type does Console.ReadLine() automatically set? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What data type does Console.ReadLine() automatically set?

I made a basic calculator, and I had to convert to char before using operation symbols. I'm still a beginner.

5th Mar 2017, 4:10 PM
Sterling Richard
Sterling Richard - avatar
3 Answers
+ 5
Try learning using pseudocode or flowcharts, most people commonly can learn effectively from those.
5th Mar 2017, 4:35 PM
Wen Qin
Wen Qin - avatar
+ 4
It normally sets an Object type or string by default. But you can use convert methods/functions to get around with it. Just make sure to catch errors if your user sometimes inputs letters instead of numbers for numerical values.
5th Mar 2017, 4:24 PM
Wen Qin
Wen Qin - avatar
0
Thanks. I don't understand functions yet. Im still learning for loops. The highest I understand is: /* This would print 0-10. */ int x = 0; for (x=0, x<10, x++) { Console.WriteLine(x); } Any advice?
5th Mar 2017, 4:31 PM
Sterling Richard
Sterling Richard - avatar