User Input | Sololearn: Learn to code for FREE!


User Input

I racked my brain out for many many tries. What is the solution? Many thanks! namespace SoloLearn { class Program { static void Main(string[] args) { int age = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("You are {0} years old", age); } }

5/28/2020 2:20:44 PM


5 Answers

New Answer


If is working right ,maybe you forgot to close opening curly bracket? Or what is the error you are getting?


Did you delete all the imports above the namespace-line? This would break the code as well...


It works fine if you: 1. Add the imports. 2. Add a last closing curly brace at the end of your code. See


Finally: Do not copy & paste!


i hust cut and pasted the text from the C# Sololearn tutorial. i believe the syntax and punctuation is cottect. Do you input the string name in my case twenty one or the int age 21 into the coding text? i tried several times using strings and numbers.