0
Was wondering how to get this code to print my name after the input of it. I get an error message after the input. http://www.sololearn.com/app/csharp/playground/cGKtkKCiph1T/
2 ответов
+ 8
Hi Daniel
Was just a little problem in the readline, follow:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
class Person
{
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
}
static void Main(string[] args)
{
Person p = new Person();
Console.WriteLine("What is your name?");
p.Name = Console.ReadLine();
Console.WriteLine(p.Name);
}
}
}
If you want upvote my answer please.
0
Thanks Ricardo.