You can use the break to terminate the loop.
for (i = 0; i < 20; i++)
{
Console.Write("Enter a number (0=stop): ");
arr1[i] = int.Parse(Console.ReadLine());
if (arr1[i] == 0) {
break;
}
}
You would need to handle the program termination; perhaps another variable?