using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Testes
{
class Program
{
static void Main(string[] args)
{
int[] ticket = new int[5];
string[] nome = new string[5];
for(int i = 1; i < 6; i++)
{
Console.WriteLine("Bem vindo, digite seu nome: ");
ticket[i] = i;
nome[i] = Console.ReadLine();
Console.WriteLine("Ticket número {0} do Sr. {1}", ticket[i], nome[i]);
Console.WriteLine("Pressione Enter");
}
Console.ReadKey();
}
}
}
The error that appears is:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in Testes.exe