- 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??
2 odpowiedzi
0
Just use: x = Console.ReadLine();
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 ;)