I just started learning C# and this is my code of a simple program for homework:
using System;
namespace Concatenate_Data
{
class Program
{
static void Main(string[] args)
{
string firstName = Console.ReadLine();
string lastName = Console.ReadLine();
int age = int.Parse(Console.ReadLine());
string town = Console.ReadLine();
Console.WriteLine($"You are {0} {1}, a {2}-years old person from {3}.", firstName, lastName, age, town);
}
}
}
Instead of outputting for instance "You are Peter Johnson, a 20-years old person from Sofia.", it outputs "You are 0 1, a 2-years old person from 3. How can I fix this? I even copied the code 1:1 from the sample they gave us.