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); }

30th Nov 2020, 8:23 AM
Vaitua Make
Vaitua Make - avatar
2 Réponses
+ 2
Syntax error Console.Readline -> Console.ReadLine Convert.toInt32 -> Convert.ToInt32
30th Nov 2020, 9:13 AM
Ipang
0
😅 Thank you...just typing problem. Gosh! 😉
30th Nov 2020, 8:37 PM
Vaitua Make
Vaitua Make - avatar