I have to check second value in array if is equal to zero. It's working on my first example, where is user input not looped. But is not working on second example, where user input is looped.
First example
int[] array = new int[4];
array[0] = int.Parse(Console.ReadLine());
array[1] = int.Parse(Console.ReadLine());
//This statement Works here
if (array[1] == 0)
{
Console.WriteLine("Alert!");
}
array[2] = int.Parse(Console.ReadLine());
array[3] = int.Parse(Console.ReadLine());
Second example
int[] array = new int[4];
for (int i = 0; i < array.Length; i = i + 1)
{
//Input
array[i] = int.Parse(Console.ReadLine());
//This statement is not working
if (array[1] == 0)
{
Console.WriteLine("Alert!");
}
array[1]in the second case and see what's in it?