0
C# Console.Readline() problem
In the sololearn app IDE i am getting an error for the compilation. It says that It cannot convert an string to an int. The code looks like this. Can someone help me? Thanks. static void Main(string[] args) { //your code goes here string name = Console.Readline(); int age = Convert.toInt32 (Console.Readline ()); Console.Write("Name: {0} \n Age: {1}",name, age); }
2 Respostas
+ 2
Syntax error
Console.Readline -> Console.ReadLine
Convert.toInt32 -> Convert.ToInt32
0
😅
Thank you...just typing problem. Gosh! 😉