for console.readline y don't yu give like.. console.readline(),x; as yu do in console.writeline("result:{0}",x); ?? if yu simply give readline() which value does the readline fetches?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

for console.readline y don't yu give like.. console.readline(),x; as yu do in console.writeline("result:{0}",x); ?? if yu simply give readline() which value does the readline fetches??

13th Sep 2016, 2:30 PM
venkat
venkat - avatar
2 Answers
0
Just use: x = Console.ReadLine();
13th Sep 2016, 3:44 PM
Sebastian
Sebastian - avatar
0
It's good to know that if the variable is non string type you must to convert it For example : int x = 0; X = int.Parse(Console.ReadLine ()) ; In this case the variable x was enabled to receive an int value. The same case happen with float for example : float x = 0; X = float.Parse (Console.ReadLine ()) ; Hope this was helpful ;)
15th Sep 2016, 5:52 AM
jonatasomartins
jonatasomartins - avatar